Opened 16 years ago

Closed 12 years ago

#526 closed defect (fixed)

Adding a new user and new address without geography causes exception on fk_c_g

Reported by: Mark J. Millard Owned by: bweaver
Priority: major Milestone: Release Candidate 2
Component: Admin Tool Version: 2.0.1423
Severity: Keywords: new user
Cc: brockweaver@… Database Engine: SQL Server
Operating System: Windows 7 Ultimate 64 bit

Description

When you add a new user and add a new address without adding anything more and doing a save you get this exception.

If you search and add geography then the save works.

Thanks to nc7lb for discover and I verified.

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

Exception Text
System.Data.SqlClient.SqlException: The INSERT statement conflicted with the FOREIGN KEY constraint "fk_c_g". The conflict occurred in database "gringlobal", table "dbo.geography", column 'geography_id'.
The statement has been terminated.

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.SqlDataReader.ConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
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.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteScalar()
at GrinGlobal.Core.DataManagers.SqlDataManager.executeInsert(IDbCommand cmd)
at GrinGlobal.Core.DataManager.Write(DataCommand cmd, Boolean returnId, String nameOfSequenceOrPrimaryKeyField)
at GrinGlobal.Core.DataManager.Write(String procOrSql, Boolean returnId, String nameOfSequenceOrPrimaryKeyField, DataParameters dps)
at GrinGlobal.Business.SecureData.SaveUser(Int32 userID, String userName, Boolean enabled, Int32 cooperatorID, Int32 currentCooperatorID, String title, String firstName, String lastName, String job, String discipline, String organization, String organizationCode, Int32 languageID, Boolean isActive, String addressLine1, String addressLine2, String addressLine3, String city, String postalIndex, String email, String primaryPhone, String secondaryPhone, String fax, Int32 siteID, String regionCode, String categoryCode, Int32 geographyID, String note)
at GrinGlobal.Admin.AdminHostProxy.SaveUser(Int32 userID, String userName, Boolean enabled, Int32 cooperatorID, Int32 currentCooperatorID, String title, String firstName, String lastName, String job, String discipline, String organization, String organizationCode, Int32 languageID, Boolean isActive, String addressLine1, String addressLine2, String addressLine3, String admin1, String admin2, String email, String primaryPhone, String secondaryPhone, String fax, Int32 siteID, String regionCode, String categoryCode, Int32 geographyID, String note)
at GrinGlobal.Admin.ChildForms.frmUser.save()
at GrinGlobal.Admin.ChildForms.frmUser.btnSave_Click_1(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(MouseEventArgs 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.OnMessage(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)

Loaded Assemblies
mscorlib

Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4952 (win7RTMGDR.050727-4900)
CodeBase: ​file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll


GrinGlobal.Admin

Assembly Version: 2.0.1417.0
Win32 Version: 2.0.1417.0
CodeBase: ​file:///C:/Program%20Files%20(x86)/GRIN-Global/GRIN-Global%20Admin/GrinGlobal.Admin.exe


System.Windows.Forms

Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase: ​file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll


System

Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase: ​file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll


System.Drawing

Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase: ​file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll


GrinGlobal.InstallHelper

Assembly Version: 2.0.1417.0
Win32 Version: 2.0.1417
CodeBase: ​file:///C:/Program%20Files%20(x86)/GRIN-Global/GRIN-Global%20Admin/GrinGlobal.InstallHelper.DLL


GrinGlobal.Core

Assembly Version: 2.0.1417.0
Win32 Version: 2.0.1417
CodeBase: ​file:///C:/Program%20Files%20(x86)/GRIN-Global/GRIN-Global%20Admin/GrinGlobal.Core.DLL


GrinGlobal.Business

Assembly Version: 2.0.1417.0
Win32 Version: 2.0.1417
CodeBase: ​file:///C:/Program%20Files%20(x86)/GRIN-Global/GRIN-Global%20Admin/GrinGlobal.Business.DLL


System.Configuration.Install

Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase: ​file:///C:/Windows/assembly/GAC_MSIL/System.Configuration.Install/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.Install.dll


System.Xml

Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase: ​file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll


System.Configuration

Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase: ​file:///C:/Windows/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll


System.Data

Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase: ​file:///C:/Windows/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll


System.Transactions

Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase: ​file:///C:/Windows/assembly/GAC_32/System.Transactions/2.0.0.0__b77a5c561934e089/System.Transactions.dll


System.EnterpriseServices

Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase: ​file:///C:/Windows/assembly/GAC_32/System.EnterpriseServices/2.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll


System.Web

Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase: ​file:///C:/Windows/assembly/GAC_32/System.Web/2.0.0.0__b03f5f7f11d50a3a/System.Web.dll


GrinGlobal.Interface

Assembly Version: 2.0.1417.0
Win32 Version: 2.0.1417
CodeBase: ​file:///C:/Program%20Files%20(x86)/GRIN-Global/GRIN-Global%20Admin/GrinGlobal.Interface.DLL


System.Core

Assembly Version: 3.5.0.0
Win32 Version: 3.5.30729.4926 built by: NetFXw7
CodeBase: ​file:///C:/Windows/assembly/GAC_MSIL/System.Core/3.5.0.0__b77a5c561934e089/System.Core.dll


System.Web.Services

Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase: ​file:///C:/Windows/assembly/GAC_MSIL/System.Web.Services/2.0.0.0__b03f5f7f11d50a3a/System.Web.Services.dll


winprjwa

Assembly Version: 2.0.1417.0
Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase: ​file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll


JIT Debugging
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>

<system.windows.forms jitDebugging="true" />

</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

Change History (6)

comment:1 by bweaver, 16 years ago

Status: new → accepted

Can recreate, thank you for descriptive ticket.

comment:2 by bweaver, 16 years ago

Status: accepted → addressed

(In [1424]) - fixes #526, can now save user without selecting a valid geography. Is this desired behavior -- or should Admin Tool force user to select a geography before saving?

comment:3 by Mark J. Millard, 16 years ago

Cc: brockweaver@… added

I see that a small org may have few users and everyone knows where they are so will want the convenience. However, I think it is only a small inconvenience to put something in and so I think it should be required.

comment:4 by bweaver, 16 years ago

Status: addressed → released

comment:5 by Mark J. Millard, 12 years ago

Status: released → verified

This was fixed some time back and is still ok in version 1.9.1. The admin tool requests that geography be filled in if not. No exception is thrown.

comment:6 by Mark J. Millard, 12 years ago

Resolution: → fixed
Status: verified → closed
Note: See TracTickets for help on using tickets.