I am experiencing to me a weird problem with my datatables. I have a dataset which contains multiple datatables, generated from stored procedures and tables by the drag and drop interface in VS 2005. However when I am populating these tables i get an error message saying
A first chance exception of type 'System.NullReferenceException' occurred in Server.DLL
Server.DLL is my business layer. It appears that this appears on a non-regular basis but by stepping through my code I have located the error to be in the following snippet
returnTable = new IssuesDataset.IssueReportsReadableDataDataTable();
tempTable = sqlServerImpersonation.ExecuteDataset([REMOVED BY AUTHOR, GETS A DATASET]).Tables;
//Here is the error thrown, sometimes the debugger points out that DataRow //dataRow is the reason, other times the keyword in and other times again //the bracket below the foreach statement
foreach (DataRow dataRow in tempTable.Rows)
The datatable is populated and it works, but this error is driving me insane...
Hopefully someone has an idea about what's causing this.