From: Martin R. <ne...@mi...> - 2003-09-19 20:15:10
|
Hi, I try use dataset with fbCommand for Delete and Update. Stored procedure is CREATE PROCEDURE SP_LSTRED_D ( RID INTEGER) AS BEGIN DELETE FROM LSTRED WHERE (RID = :RID); END Source in C# VS2003 protected FirebirdSql.Data.Firebird.FbCommand fbCMainDelete; * private void SetupDeleteComm { fbCMainDelete.Connection=FGlobalData.PrikladConnection(); FMainDataAdapter.DeleteCommand=fbCMainDelete; FMainDataAdapter.CommandText="EXECUTE PROCEDURE SP_LSTRED_D (?)"; FMainDataAdapter.DeleteCommand.Parameters.Add("RID", firebird.FbDbType.Integer,0,"RID"); } * When I fire private void sbbtnDelete_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { FMainCurrencyManager.RemoveAt(FMainCurrencyManager.Position); cause error -> FMainDataAdapter.Update(MainDataSet,GetTblName()); } then I every times get error message " An unhandled exception of type 'System.Data.DBConcurrencyException' occurred in system.data.dll Additional information: Concurrency violation: the DeleteCommand affected 0 records." Could anybody help me please? if I fire this procedure than it works but affected rows is still 0 firebird.FbTransaction trans = FGlobalData.PrikladConnection().BeginTransaction(); fbCMainDelete.Transaction = trans; fbCMainDelete.Parameters["RID"].Value = 16; MessageBox.Show(Convert.ToString(fbCMainDelete.ExecuteNonQuery())); trans.Commit(); If I don't use transaction then it don't work too. What I do wrong. Please help me. Thank you very much. |