I have a datatable which i'm populating in memory with 5million rows. The idea is that i do this in batches so for every million i clear the variable and start again by running the the following code.
dt = Nothing
dt = New DataTable
dt = GetDataTableSchema()
tempRow = Nothing
tempRow = dt.NewRow
However for some reason this doesnt free the memory straight away, and my application is running out of memory.
Can anyone tell me what im doing wrong here?