Group: StrataFrame Users
Posts: 2.4K,
Visits: 23K
|
Hi, When trying to delete a parent record, the MS-SQL2005 throws an execption preventing the deletion of the record, which is just fine. Is there a way to trap this exception and display a more user friendly message? or is there something in SF tha will take care of this for us? Here is the Exception message: SqlException The DELETE statement conflicted with the REFERENCE constraint "Has_many". The conflict occurred in database "ATR", table "dbo.ServiceCalls", column 'FK_Customers'. The statement has been terminated. Source : .Net SqlClient Data Provider Stack Trace: at System.Data.SqlClient.SqlConnection.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 MicroFour.StrataFrame.Data.DbDataSourceItem.InternalExecuteNonQuery(DbCommand Command, Boolean IsTransactional, String TransactionKey) at MicroFour.StrataFrame.Data.DbDataSourceItem.ExecuteNonQuery(DbCommand Command, Boolean IsTransactional, String TransactionKey) at MicroFour.StrataFrame.Data.DataLayer.DeleteByPrimaryKey(PrimaryKeyValue PKValue, DataRow Row) at MicroFour.StrataFrame.Business.BusinessLayer.DeleteByPrimaryKey(PrimaryKeyValue PKValue) at MicroFour.StrataFrame.Business.BusinessLayer.DeleteCurrentRow(Boolean CheckSecurity, Boolean OnlyMarkAsDeleted) at ATR_System.frmCustomers.tsiDelete_Click(Object sender, EventArgs e) in E:\Visual Studio 2005\StrataFrame Projects\ATR Systems\ATR System with not security\ATR System\Forms\frmCustomers.vb:line 217 at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e) at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e) at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e) at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ToolStrip.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativewindow.WndProc(Message& m) at System.Windows.Forms.Nativewindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Edhy Rijo
|