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...