J
John Sweet
In the following code, is it OK to return the DataTable, or should I return
the DataSet so that it can be disposed in the calling code? In other words,
do I need to Dispose() a DataSet or will the framework clean it up for me?
public DataTable GetSomeData()
{
DataSet myDataSet = new DataSet();
// populate the dataset from SQL Server
return myDataSet.Tables[0];
}
the DataSet so that it can be disposed in the calling code? In other words,
do I need to Dispose() a DataSet or will the framework clean it up for me?
public DataTable GetSomeData()
{
DataSet myDataSet = new DataSet();
// populate the dataset from SQL Server
return myDataSet.Tables[0];
}