I had a problem with the database and tried to Reset it.
Here is the trace that I got :
2009-10-15 22:26:08:830 in OnUnhandledThreadException
2009-10-15 22:26:08:971 ********* exception trapped *********
2009-10-15 22:26:08:971 The primary key value cannot be deleted because references to this key still exist. [ Foreign key constraint name = FK__nt_strategy2strategy__00000000000002D4 ]
2009-10-15 22:26:08:971 at System.Data.SqlServerCe.SqlCeCommand.ProcessResult s(Int32 hr)
at System.Data.SqlServerCe.SqlCeCommand.ExecuteComman dText(IntPtr& pCursor, Boolean& isBaseTableCursor)
at System.Data.SqlServerCe.SqlCeCommand.ExecuteComman d(CommandBehavior behavior, String method, ResultSetOptions options)
at System.Data.SqlServerCe.SqlCeCommand.ExecuteNonQue ry()
at Wilson.ORMapper.Internals.Connection.ExecuteComman d(Type entityType, CommandInfo commandInfo, String sqlStatement, Parameter[] parameters)
at Wilson.ORMapper.ObjectSpace.ExecuteDelete(Type objectType, String whereClause)
at NinjaTrader.Gui.OptionsForm.OnResetDB(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventAr gs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Comment