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 getting records in the gridview but no option for inserting new records(screen shot attached).. where as i can update the reocrds from the grid view.
Is there any option or property for enabling the insertion option in the gridview ?
Buttonclickcode :
private void RetrieveRules_button_Click(object sender, EventArgs e)
{
this.dataGridView.DataSource = null;
this.dataGridView.Rows.Clear();
SqlCommand cmd1 = con.CreateCommand();
cmd1.CommandType = CommandType.Text;
cmd1.CommandText = @" Select TOP 1 * FROM " + schemaName + "[ERSBusinessLogic] ORDER BY ERSBusinessLogic_ID DESC";
con.Open();
cmd1.ExecuteNonQuery();
DataTable dt = new DataTable();
SqlDataAdapter DA = new SqlDataAdapter(cmd1);
DA.Fill(dt);
dataGridView.DataSource = dt;
con.Close();
}
Thanks
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…