Geeks With Blogs
Rahul Anand's Blog If my mind can conceive it, and my heart can believe it, I know I can achieve it. March 2007 Entries
Unexpected behavior in DataTable.NewRow()
Today I encountered some weird behavior in .NET Framework. I had written some code like: [CODE] while (reader.Read()) { DataRow row = dtSchema.NewRow(); // The above line was throwing Out of Memory Exception for (int i = 0; i < reader.FieldCount; i++) { row[i] = reader.GetValue(i); } // Some logic which uses this row } [/CODE] Since I was not adding this row to the DataTable Rows collection, my assumption was it will not affect the memory allocation of DataTable (dtSchema). But I found that the ......

Posted On Friday, March 2, 2007 10:24 PM

Copyright © Rahul Anand | Powered by: GeeksWithBlogs.net