Information générale
Titre:
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.
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement