Home All Groups Group Topic Archive Search About
Author
9 Aug 2006 11:44 AM
Peter Newman
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?

Author
9 Aug 2006 12:16 PM
Cor Ligthert [MVP]
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

Show quoteHide quote
"Peter Newman" <PeterNew***@discussions.microsoft.com> schreef in bericht
news:FAF97D47-B20C-4F11-89A1-16C335D623C5@microsoft.com...
> 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?
Author
9 Aug 2006 12:25 PM
Peter Newman
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

Show quoteHide quote
"Cor Ligthert [MVP]" wrote:

> 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
>
> "Peter Newman" <PeterNew***@discussions.microsoft.com> schreef in bericht
> news:FAF97D47-B20C-4F11-89A1-16C335D623C5@microsoft.com...
> > 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?
>
>
>
Author
9 Aug 2006 2:25 PM
Cor Ligthert [MVP]
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

Show quoteHide quote
"Peter Newman" <PeterNew***@discussions.microsoft.com> schreef in bericht
news:5DB74A22-0223-45E1-9794-CD8EE203BF33@microsoft.com...
> 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
>
> "Cor Ligthert [MVP]" wrote:
>
>> 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
>>
>> "Peter Newman" <PeterNew***@discussions.microsoft.com> schreef in bericht
>> news:FAF97D47-B20C-4F11-89A1-16C335D623C5@microsoft.com...
>> > 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?
>>
>>
>>
Author
15 Aug 2006 7:48 AM
Peter Newman
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 ??

Show quoteHide quote
"Cor Ligthert [MVP]" wrote:

> 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
>
> "Peter Newman" <PeterNew***@discussions.microsoft.com> schreef in bericht
> news:5DB74A22-0223-45E1-9794-CD8EE203BF33@microsoft.com...
> > 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
> >
> > "Cor Ligthert [MVP]" wrote:
> >
> >> 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
> >>
> >> "Peter Newman" <PeterNew***@discussions.microsoft.com> schreef in bericht
> >> news:FAF97D47-B20C-4F11-89A1-16C335D623C5@microsoft.com...
> >> > 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?
> >>
> >>
> >>
>
>
>
Author
15 Aug 2006 8:14 AM
Cor Ligthert [MVP]
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

Show quoteHide quote
"Peter Newman" <PeterNew***@discussions.microsoft.com> schreef in bericht
news:EE17E5FE-8E8C-46D7-92F3-6686FE60DC2C@microsoft.com...
> 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 ??
>
> "Cor Ligthert [MVP]" wrote:
>
>> 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
>>
>> "Peter Newman" <PeterNew***@discussions.microsoft.com> schreef in bericht
>> news:5DB74A22-0223-45E1-9794-CD8EE203BF33@microsoft.com...
>> > 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
>> >
>> > "Cor Ligthert [MVP]" wrote:
>> >
>> >> 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
>> >>
>> >> "Peter Newman" <PeterNew***@discussions.microsoft.com> schreef in
>> >> bericht
>> >> news:FAF97D47-B20C-4F11-89A1-16C335D623C5@microsoft.com...
>> >> > 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?
>> >>
>> >>
>> >>
>>
>>
>>