I have researching through very simple code and get stuck on seeing the dispose() result of datatable
Following is the code
DataTable dt= new Datatable();
SqlCommand Cmd = new SqlCommand("sp_getData",SqlCon);
SqlCommand.CommandType= CommandType.StroedProcedure;
SqlCon.Open();
sqlDataReader dr= cmd.ExecuteReader();
dt.Load(dr);
SqlCon.Close();
grdView.DataSource =dt;
dt.Dispose() // Here I dispose the table as it is no use for me & wanna memory free from this
But after disposing off the datatable i still found that it is still showing RowCount = 10k.
Does Dispose() method does not free up the memory & make object as null ??
How can i make it as null or free up the memory occupied by this object ??
See Question&Answers more detail:os