1
Reply

datagridview

kal k

kal k

May 22 2006 4:38 PM
2.3k

Hi,
Iam using datagridview,How to add a new row to the datagrid view?
In insert button i wrote  this code,
dataGridView1.Rows.Add(3);
when i run this code,it is giving the following exception
exception: rows cannot be programatically to the datagridview's collection when control is databound

In save button i wrote like this,

private void button1_Click(object sender, EventArgs e)

{da.Update(ds,"emp");

}

It is giving the following exception:

 Update requires a valid InsertCommand when passed DataRow collection with new rows.


Please help me.
Thanks In Advance



Answers (1)