I\'m trying to insert new records into the source table from the C# interface grid view.... But when I retrieve the records with the buttonclick code shown below... Im getti
Code is using ExecuteNonQuery, it returns no of rows affected not the results your query returns.
Use ExecuteReader
instead.
var reader = cmd1.ExecuteReader();
DataTable dt = new DataTable();
dtLoad(reader);
Is there any option or property for enabling the insertion option in the gridview
dataGridView1.ReadOnly = false;
dataGridView1.EditMode = DataGridViewEditMode.EditOnF2; //if you want to edit on F2.