I was making a c# winform application in SharpDevelop using Net Framework 4. The application is almost complete but I decided to use Visual Studio 13 Community Edition. When I run application in this through Visual Studio, It is giving me strange exception (RowNotInTableException when I delete some row in Datagridview). I again run the application in SharpDevelop and there was no exception.
My question is, are these new exceptions from Visual Studio or already existed in my code which are now being discovered by Visual Studio. and how can I fix them now???
Now I cannot check my complete application again in Visual Studio to see whether there are new exceptions or not??
I have a datagridview, datatable (dt) and a bindingsource (bs).
bs.DataSource = dt;
dataGridView1.DataSource = bs;
Now if I add some data in datagridview in the running application and then select the entire row by clicking the row header and then press "delete key" on keyboard. It gives me exception in the following code.
The exception is:
An exception of type System.Data.RowNotInTableException occurred in System.Data.dll but was not handled in user code
Additional information: This row has been removed from a table and does not have any data. BeginEdit() will allow creation of new data in this row.
dataGridView1.DataBindingComplete += (S,E)=>
for(int i = 0; i < dt.Rows.Count; i++)
if (dt.Rows[i]["order Ref No."].ToString() != "")