Error on Update ??

Posts   
 
    
Sandumone
User
Posts: 22
Joined: 29-Nov-2008
# Posted on: 15-Dec-2008 17:15:48   

The code written

                AppModelDbInstanceEntity appModelDB = new AppModelDbInstanceEntity();
                appModelDB.AppId = 15;
                decimal appid = appModelDB.AppId;
                appModelDB.LogicalModelNm = "15";
                appModelDB.MachineId = GVMachineViewList.Rows[i].Cells[1].Text;
                appModelDB.InstanceNm = GVMachineViewList.Rows[i].Cells[2].Text; ;
                appModelDB.PhysDatabaseNm = GVMachineViewList.Rows[i].Cells[4].Text;
                appModelDB.ProductNm = GVMachineViewList.Rows[i].Cells[3].Text;

                mAdaptersecond.SaveEntity(appModelDB);

error comes when it tries to save.

error received :

SD.LLBLGen.Pro.ORMSupportClasses.ORMQueryExecutionException was unhandled by user code Message="An exception was caught during the execution of an action query: RI error\r\nThe transaction ended in the trigger. The batch has been aborted.. Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception." Source="SD.LLBLGen.Pro.ORMSupportClasses.NET20" RuntimeBuild="11142008" RuntimeVersion="2.6.0.0" QueryExecuted="\r\n\tQuery: INSERT INTO [DBINFO].[dbo].[app_model_db_instance] ([app_id], [logical_model_nm], [machine_id], [instance_nm], [phys_database_nm], [product_nm]) VALUES (@AppId, @LogicalModelNm, @MachineId, @InstanceNm, @PhysDatabaseNm, @ProductNm)\r\n\tParameter: @AppId : Decimal. Length: 0. Precision: 10. Scale: 0. Direction: Input. Value: 15.\r\n\tParameter: @LogicalModelNm : String. Length: 40. Precision: 0. Scale: 0. Direction: Input. Value: \"15\".\r\n\tParameter: @MachineId : String. Length: 65. Precision: 0. Scale: 0. Direction: Input. Value: \"\".\r\n\tParameter: @InstanceNm : String. Length: 130. Precision: 0. Scale: 0. Direction: Input. Value: \"\".\r\n\tParameter: @PhysDatabaseNm : String. Length: 65. Precision: 0. Scale: 0. Direction: Input. Value: \"\".\r\n\tParameter: @ProductNm : String. Length: 30. Precision: 0. Scale: 0. Direction: Input. Value: \"\".\r\n" StackTrace: at SD.LLBLGen.Pro.ORMSupportClasses.ActionQuery.Execute() at SD.LLBLGen.Pro.ORMSupportClasses.BatchActionQuery.Execute() at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.ExecuteActionQuery(IActionQuery queryToExecute) at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.PersistQueue(List`1 queueToPersist, Boolean insertActions, Int32& totalAmountSaved) at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.SaveEntity(IEntity2 entityToSave, Boolean refetchAfterSave, IPredicateExpression updateRestriction, Boolean recurse) at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.SaveEntity(IEntity2 entityToSave) at ENVWeb.AssignInstsDbsSchemas.Submit_Click(Object sender, EventArgs e) in C:\Documents and Settings\NBKVKMM\Desktop\ENVWeb__dec12th11.26\ENVWeb\AssignInstsDbsSchemas.ascx.cs:line 109 at System.Web.UI.WebControls.Button.OnClick(EventArgs e) at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) InnerException: System.Data.SqlClient.SqlException Message="RI error\r\nThe transaction ended in the trigger. The batch has been aborted." Source=".Net SqlClient Data Provider" ErrorCode=-2146232060 Class=16 LineNumber=36 Number=50000 Procedure="iu_app_model_db_instance" Server="crpcltmsqhf" State=10 StackTrace: at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at SD.LLBLGen.Pro.ORMSupportClasses.ActionQuery.Execute() InnerException:

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39859
Joined: 17-Aug-2003
# Posted on: 15-Dec-2008 18:12:33   

The error says: "The transaction ended in the trigger" (as stated in the exception). So you should first look at the trigger on the table.

Frans Bouma | Lead developer LLBLGen Pro