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
 
Back
Top