I've a button on my frmMain that opens up another frmEdit which has a datagridview that displays the following query:
BindingSource bs = new BindingSource();
string sqlqry = "select p_Name from Items where p_Id=" + p_Id;
SqlCeCommand cmd = new SqlCeCommand(sqlqry1, conn);
SqlCeDataReader rdr = cmd.ExecuteReader();
bs.DataSource = rdr;
dataGridView1.DataSource = bs;
this.ShowDialog(parent);
When frmEdit loads up the DataGridView
displays the query just fine, but I can't Edit. I tried dgv.BeginEdit(true)
, but it doesn't work. The EditMode works fine if I used wizard to bind datasources to the dgv, but I need to execute my own customized queries and be able to update them directly.