DataSet Disposal

  • Thread starter Thread starter TCORDON
  • Start date Start date
T

TCORDON

Should 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
 
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.
 
No, theres no reason to do this. Note that with DataReaders, its a
different story.
But disposing DataSets isnt needed.

HTH,
Premier JiangZemin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top