|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
|
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 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? 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? > > > 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? >> >> >> 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? > >> > >> > >> > > > 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? >> >> >> >> >> >> >> >> >>
FileListBox from VB6?
Help with first VB application - Data Entry form Easy Value Compare Question MS VB Newbie Tutorial Check to see if a server is running Check if a Windows service running Writing to a file opened in another class CreateObject does not work consistently in X64 systems Me.Hide() Test Post |
|||||||||||||||||||||||