S
Steve
Hello,
Let's say I open a form and populate a grid and a few textboxes with a
dataset, something like this (I won't go into detail, because the code does
work, I just don't know how streamlined it is):
Form Load
Dim DataSet
Dim Connection
Open Connection
Setup DataAdapter
Fill DataSet
Bind grid and textboxes
Close Connection
Now say I make a few changes, and after every change I want to write the
change back to the database (These changes can be minutes apart, so waiting
to update all at once is not what I want to do). Do I need to repeat all the
steps from the Form Load Procedure (minus the binding parts)? So if I have a
button that updates the database, it would be something like:
Button_Click
Dim Connection
Dim DataAdapter
Setup DataAdapter
Dim CommandBuilder
Setup CommandBuilder
Open Connection
Dim DataSet
Fill DataSet
Make Changes
Update DataAdapter
Close Connection
Now, this works fine, but I just don't know if I'm wasting resources, or
slowing my program down by doing this, because I'm going to have to do this
alot throughout my forms. Thanks to anyone in advance.
Steve
Let's say I open a form and populate a grid and a few textboxes with a
dataset, something like this (I won't go into detail, because the code does
work, I just don't know how streamlined it is):
Form Load
Dim DataSet
Dim Connection
Open Connection
Setup DataAdapter
Fill DataSet
Bind grid and textboxes
Close Connection
Now say I make a few changes, and after every change I want to write the
change back to the database (These changes can be minutes apart, so waiting
to update all at once is not what I want to do). Do I need to repeat all the
steps from the Form Load Procedure (minus the binding parts)? So if I have a
button that updates the database, it would be something like:
Button_Click
Dim Connection
Dim DataAdapter
Setup DataAdapter
Dim CommandBuilder
Setup CommandBuilder
Open Connection
Dim DataSet
Fill DataSet
Make Changes
Update DataAdapter
Close Connection
Now, this works fine, but I just don't know if I'm wasting resources, or
slowing my program down by doing this, because I'm going to have to do this
alot throughout my forms. Thanks to anyone in advance.
Steve