N
Neeraj
hi
I am using datagridview and sql Express as a datasource i populate
data but not able to update through datagridview
i am using such code
dataAdpter = new System.Data.SqlClient.SqlDataAdapter("select MGenID,
General, status from General where status = 1", connect);
dataset = new DataSet();
dataAdpter.Fill(dataset, nodeValue);
grdMastervalue.DataSource = dataset.Tables[0];
data is showing proporly
for update the data i write code on button click event
private void btnEdit_Click(object sender, EventArgs e)
{
this.Validate();
this.grdMastervalue.EndEdit();
this.dataAdpter.Update(this.dataset, nodeValue);
}
then last line generate exception
An unhandled exception of type 'System.InvalidOperationException'
occurred in System.Data.dll
Additional information: Update requires a valid UpdateCommand when
passed DataRow collection with modified rows.
Please tell where i am wrong
thanks
Neeraj Kumar
I am using datagridview and sql Express as a datasource i populate
data but not able to update through datagridview
i am using such code
dataAdpter = new System.Data.SqlClient.SqlDataAdapter("select MGenID,
General, status from General where status = 1", connect);
dataset = new DataSet();
dataAdpter.Fill(dataset, nodeValue);
grdMastervalue.DataSource = dataset.Tables[0];
data is showing proporly
for update the data i write code on button click event
private void btnEdit_Click(object sender, EventArgs e)
{
this.Validate();
this.grdMastervalue.EndEdit();
this.dataAdpter.Update(this.dataset, nodeValue);
}
then last line generate exception
An unhandled exception of type 'System.InvalidOperationException'
occurred in System.Data.dll
Additional information: Update requires a valid UpdateCommand when
passed DataRow collection with modified rows.
Please tell where i am wrong
thanks
Neeraj Kumar