I create a datatable like this:
strSQL = "My SQL String";
cmd.CommandText = strSQL;
DataTable dtBMP = new DataTable();
dtBMP.Load(cmd.ExecuteReader());
I'm looping through it, and I'd like to add data like this:
DataRow dr = dt.Rows[RowIndex];
dr[ColIndex] = "My Value";
But it keeps telling me that that cell is read-only. I've tried adding:
dr.ReadOnly = false;
But then I get the error "'System.Data.DataRow' does not contain a definition for 'ReadOnly' and... etc."
Is there some straightforward way to create a datatable in read/write mode? Or some other way to solve this problem? Thanks.