General information
Title:
DataTables and Memory
Please help me understand memory de-allocation -- when something gets dumped from RAM. On a windows form (c#):
private void load_customer_combobox()
{
DataSet ds...
DataAdapter da...
...
da.Fill(da,"customers"); // FILL RAM WITH RECORDS HERE
.customer_combobox.DataSource = ds.customers; // POINTER TO RECORDS IN RAM
...
return;
}
Now combobox is loaded and lists customers - works great! Here is my question:
The local ds and da variables have gone out of scope and .customer_combobox.DataSource is the remaining pointer to the DataTable... will the memory occupied by DataTable be released when I close the window or is this a memory leak and I have to add extra code to release it?
Second question: Is the DataSet lost in the above code and only the DataTable exists in RAM or will a DataTable keep the DataSet alive?
I'm asking because I don't want to create any memory problems. Thank you in advance for your help.
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only