|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
DataSet DisposalShould I Dispose a DataSet immediately after binding a control to it's data?
cbox.DataSource=DS etc... etc... cbox.DataBind() DS.Dispose TIA The reason I ask this is because I have a WebForm that loads and binds a
couple of controls to diferent DataSets, but if I close the IE window sometimes i get an error Message: "The instruction at 0x00d95f6c referenced memory at 0x00d95f6c. The memory could not me read." Thanks Show quoteHide quote "TCORDON" <tcord***@hotmail.com> wrote in message news:OQqsF7yLFHA.3320@TK2MSFTNGP15.phx.gbl... > Should I Dispose a DataSet immediately after binding a control to it's > data? > > cbox.DataSource=DS > etc... > etc... > cbox.DataBind() > DS.Dispose > > TIA > > No, since the DataSet is disconnected from the datasource, there's really no
reason to be concerned with this. The DataSet will be automatically disposed. Show quoteHide quote "TCORDON" <tcord***@hotmail.com> wrote in message news:OQqsF7yLFHA.3320@TK2MSFTNGP15.phx.gbl... > Should I Dispose a DataSet immediately after binding a control to it's > data? > > cbox.DataSource=DS > etc... > etc... > cbox.DataBind() > DS.Dispose > > TIA > > No, theres no reason to do this. Note that with DataReaders, its a
different story. But disposing DataSets isnt needed. HTH, Premier JiangZemin Show quoteHide quote "TCORDON" <tcord***@hotmail.com> wrote in message news:OQqsF7yLFHA.3320@TK2MSFTNGP15.phx.gbl... > Should I Dispose a DataSet immediately after binding a control to it's > data? > > cbox.DataSource=DS > etc... > etc... > cbox.DataBind() > DS.Dispose > > TIA > >
Other interesting topics
web application security
unicode characters in web form aspx pages, utf-8 Javascript not working when part of asp.net page. DataGrid Sort Expression for a date in format 'dd mmm yy' getting web page - control and class to talk to one another is hard... New Cracked Software(cad,cae,cam,eda,pcb,gis,cfd,cnc...) Runing Client-side code Pop up window Urgent help needed in Regular expressions how to toggle the visibility of large chunks of a page |
|||||||||||||||||||||||