V
vj
I have the below method
private DataSet ReadNCFFile(string NCFFileName)
{
DataSet dsNCFFile = new DataSet();
try
{
dsNCFFile.ReadXml(NCFFileName);
return dsNCFFile.Copy();
}
finally
{
}
}
private void CallingMethod()
{
DataSet ds = ReadNCFFile(strFile);
}
will the dsNCFFile, get disposed by GC soon if return dsNCFFile.Copy(),
rather than dsNCFFile. I am assuming here that in the calling method, the
"ds" will receive a copy and hence the reference to the DataSet in
ReadNCFFile will be lost, so GC will garbage collect it soon??? , or I am
totally way of here?
Any ideas??
Vijay
private DataSet ReadNCFFile(string NCFFileName)
{
DataSet dsNCFFile = new DataSet();
try
{
dsNCFFile.ReadXml(NCFFileName);
return dsNCFFile.Copy();
}
finally
{
}
}
private void CallingMethod()
{
DataSet ds = ReadNCFFile(strFile);
}
will the dsNCFFile, get disposed by GC soon if return dsNCFFile.Copy(),
rather than dsNCFFile. I am assuming here that in the calling method, the
"ds" will receive a copy and hence the reference to the DataSet in
ReadNCFFile will be lost, so GC will garbage collect it soon??? , or I am
totally way of here?
Any ideas??
Vijay