DataSet Disposal

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
 
T

TCORDON

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
 
S

Steve C. Orr [MVP, MCSD]

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.
 
J

JiangZemin

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top