disposing dataSets

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am disposing the dataset using the using block

like
using(DataSet ds = new DataSet()

...
} but the I can to any assignment in side the using block , It give the exception as DataSet is read only ,

I am using the work around by declaring the dataset outside the using block

like
DataSet ds = null
using(DataSet ds = new DataSet()

...


I dont understand why I should do this can some one explai

thank
 
It works for me.
Are you sure that there is an exception on that line?

--
Miha Markic [MVP C#] - RightHand .NET consulting & software development
miha at rthand com
www.rthand.com

srinivas said:
I am disposing the dataset using the using block

like
using(DataSet ds = new DataSet())
{
...
} but the I can to any assignment in side the using block , It give the
exception as DataSet is read only ,
 
Back
Top