Dataset

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

vb.net 2003 & SQL2005

when opening a form i greate a dataset and add a table to it, what im
trying to find out is the best way to destroy the dataset when i close the
form

any ideas?
 
Peter,

There are in the system.data (adonet) no unmanaged resources. Therefore it
will be destroyed by the GC after that you have closes your program. Or do
you mean something else with your question?

Cor
 
Cor, i was hoping to be able to destroy it after i close the form. The
dataset is recreated with freash data if the operator goed in to that
sectoion of the application again

i have tried ther .dispose option when closing the form but tht hasnt worked
 
Peter,

Why will you destroy it, as it will be destroyed?

If closing the form is not closing the main form, than it is another
situation.
Is it that?

Cor
 
Cor,

That is exactly the case, the form being closed is not the main form.

If the operator reopens the sub form the i get an error as it tries to
create the dataset again. the only way i can see is to create a 'global'
dataset on the main form adn add and dropp tables each time any sub form is
opened or closed ? is this the way to go ??
 
Peter,

Normally is the best way to add a component to your project using the Add
Items in Solution Explorer and use that class for your datahandling.
(The DataAccesLayer).

If you want, than declaring a dataset shared in that class is than probably
the simplest way to do the first time that you are dealing with this.

I hope this gives an idea

Cor
 
Back
Top