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
Swapnil PalandePosted May 30, 2006, 12:58 AM
Are you using database table or you are creating table at runtime?
Exactly what do you want by inserting row?
Regards,
Swapnil