One Dataset for all forms

  • Thread starter Thread starter ck
  • Start date Start date
C

ck

Hello,

I need to create a windows application with three forms
I want to use one dataset and minimize trips to the
database.

So far, I've created my forms, configured a data adapter,
and a dataset on form1, I binded elements from the
dataset to their respective textboxes on the form. When
the form loads the dataset fills and the information
displays on the form, once I go to my second and third
forms, using show dialog (), even though the they contain
the same dataset and the bindings are done the same way
they are on form one. I would think there is a way of
doing this, obviously I'm just not sure how?

To recap, I want to fill one dataset when form1 loads and
show the same information from the same dataset when
form2 or form3 shows as a dialog without having to fill
the dataset again.

TIA
 
Hello,

I need to create a windows application with three forms
I want to use one dataset and minimize trips to the
database.

So far, I've created my forms, configured a data adapter,
and a dataset on form1, I binded elements from the
dataset to their respective textboxes on the form. When
the form loads the dataset fills and the information
displays on the form, once I go to my second and third
forms, using show dialog (), even though the they contain
the same dataset and the bindings are done the same way
they are on form one. I would think there is a way of
doing this, obviously I'm just not sure how?

To recap, I want to fill one dataset when form1 loads and
show the same information from the same dataset when
form2 or form3 shows as a dialog without having to fill
the dataset again.

TIA

Add a DataSet property to each form (forms 2 and 3) and before opening
those forms pass the DataSet object to that property. Since forms are
classes you can add your own properties to them.

If I misunderstood your post please excuse me.


Otis Mukinfus
http://www.otismukinfus.com
 
Back
Top