public bool UpdateDataSet(DataSet oDataSet, string sTableName) { bool bRetVal = true; try { oAdapter.Update(oDataSet, sTableName); } catch(SqlException e) { oException = e; bRetVal = false; } return bRetVal; }Any reason why I shouldn't iterate through all the tables & rows and call EndEdit on each row here in this method? This would put it one place as opposed to all the different areas that work with DS's.
foreach(DataTable oTable in oDataSet.Tables) { foreach(DataRow oRow in oTable.Rows) { oRow.EndEdit(); } }>Kevin,
> DataRow oRow = oDataSet.Tables[0].Rows[0].EndEdit();
>
> oAdapter.Update(oDataSet, sTableName);
>
>>>txtTitle.DataBindings.Add("Text", oDataSet, "ItemRow.Title"); >>txtCategory.DataBindings.Add("Text", oDataSet, "ItemRow.Category"); >>txtAuthor.DataBindings.Add("Text", oDataSet, "ItemRow.Author"); >>txtCatNo.DataBindings.Add("Text", oDataSet, "ItemRow.Catalogue_No"); >>txtIsbn.DataBindings.Add("Text", oDataSet, "ItemRow.Isbn"); >>txtPublisher.DataBindings.Add("Text", oDataSet, "ItemRow.Publisher"); >>>>
>>public bool UpdateDataSet(DataSet oDataSet, string sTableName) >>{ >> bool bRetVal = true; >> >> try >> { >> DataRow oRow = oDataSet.Tables[0].Rows[0]; >> DataRowState state = oRow.RowState; \\state = Unchanged >> >> oAdapter.Update(oDataSet, sTableName); >> } >> catch(SqlException e) >> { >> oException = e; >> bRetVal = false; >> } >> return bRetVal; >>} >>>>