Click to See Complete Forum and Search --> : SQL dataadapter update urgent


VChellam1972
August 16th, 2004, 11:54 AM
Hello all,

I am using a datagrid in my web page which displays information from the table
in oracle. I using oracleConnection object, dataset object and oracle dataadapter to retrieve date from the table and it works fine. Now my problem is one column
of my grid i have button named update(which is actuall mapped to edit command text of the column) as i don't want user to click edit and then update as both of them need to be done in one shot. When the user clicks the update button i want to update some information like status_id column in the dataset, call accept changes and then using dataadapter i call update method. I don't get any error or
exception, but data doesn't get updated to the database. Can anyone help me?
Its very urgent

Here is my code for the datagrid_OnEditCommand function
{
try
{
myDataGrid.EditItemIndex= e.Item.ItemIndex;
dbDataSet = (DataSet)Session["DataSet"];
oraDbMain = (OracleDataAdapter)Session["Adapter"];
DataRow dw = dbDataSet.Tables["Event"].Rows[e.Item.ItemIndex];
int iAccept = 2;
dw["Status_Id"] = iAccept;
dbDataSet.AcceptChanges();
oraDbMain.Update(dbDataSet,"Event");
myDataGrid.EditItemIndex = -1;
Session["DataSet"] = dbDataSet;
myDataGrid.DataSource = dbDataSet.Tables["Event"].DefaultView;
myDataGrid.DataBind();
}
catch(OracleException exp)
{
myDataGrid.EditItemIndex = -1;
string str = exp.Message;
}
finally
{
cnnDB.Close();
}



Thanks
venkat