I am not able to figure how will this work:
public Class1 Function1()
{
DataTable dt;
try
{
dt = new DataTable();
//.. Do some work
return new Class2(byref dt);
}
finally
{
dt.dispose();
}
}
public Class2(byref DataTable dTable)
{
this.dataTable = dTable;
}
So, now if I say Class1 obj1 = Function1();
will my obj1.dataTable
be disposed? or it will have proper data?