Opened 17 years ago
Closed 16 years ago
#413 closed defect (fixed)
Unhandled Exception when assigning a new user to a group BEFORE saving the user
| Reported by: | rlittle | Owned by: | bweaver |
|---|---|---|---|
| Priority: | major | Milestone: | Post TTT - Response Updates |
| Component: | Admin Tool | Version: | 1.5.1167 |
| Severity: | Keywords: | ||
| Cc: | Database Engine: | SQL Server | |
| Operating System: | XP Pro 32 bit |
Description
During the TTT exercises (Day 4 Review Session), the students were instructed to add a new user with certain data provided (title, first and last name, initial, primary phne, email, site code, password). They were then instructed to add the user to the CT Users group. If this action is attempted WITHOUT saving the user first, the following exception error is returned:
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_sgum_su". The conflict occurred in database "gringlobal", table "dbo.sec_user", column 'sec_user_id'.
The statement has been terminated.
at GrinGlobal.Business.SecureData.AddUsersToGroup(Int32 groupID, List`1 userIDs)
at GrinGlobal.Admin.AdminHostProxy.AddUsersToGroup(Int32 groupID, List`1 userIDs)
at GrinGlobal.Admin.ChildForms.frmUser.popupAddToGroup()
at GrinGlobal.Admin.ChildForms.frmUser.btnAddGroup_Click(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.4200 (NetFxQFE.050727-4200)
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
GrinGlobal.Admin
Assembly Version: 1.5.1177.0
Win32 Version: 1.5.1177.0
CodeBase: file:///C:/Program%20Files/GRIN-Global/GRIN-Global%20Admin/GrinGlobal.Admin.exe
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4016 (NetFxQFE.050727-4000)
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.4016 (NetFxQFE.050727-4000)
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.4016 (NetFxQFE.050727-4000)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
System.Configuration
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4016 (NetFxQFE.050727-4000)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4016 (NetFxQFE.050727-4000)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
GrinGlobal.Core
Assembly Version: 1.5.1172.0
Win32 Version: 1.5.1172
CodeBase: file:///C:/Program%20Files/GRIN-Global/GRIN-Global%20Admin/GrinGlobal.Core.DLL
GrinGlobal.Business
Assembly Version: 1.5.1172.0
Win32 Version: 1.5.1172
CodeBase: file:///C:/Program%20Files/GRIN-Global/GRIN-Global%20Admin/GrinGlobal.Business.DLL
Assembly Version: 1.5.1172.0
Win32 Version: 1.5.1172
CodeBase: file:///C:/Program%20Files/GRIN-Global/GRIN-Global%20Admin/GrinGlobal.InstallHelper.DLL
System.Configuration.Install
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4016 (NetFxQFE.050727-4000)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Configuration.Install/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.Install.dll
System.Data
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4016 (NetFxQFE.050727-4000)
CodeBase: file:///C:/Windows/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll
System.Web
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4016 (NetFxQFE.050727-4000)
CodeBase: file:///C:/Windows/assembly/GAC_32/System.Web/2.0.0.0__b03f5f7f11d50a3a/System.Web.dll
System.Transactions
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4016 (NetFxQFE.050727-4000)
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.4016 (NetFxQFE.050727-4000)
CodeBase: file:///C:/Windows/assembly/GAC_32/System.EnterpriseServices/2.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll
GrinGlobal.Interface
Assembly Version: 1.5.1172.0
Win32 Version: 1.5.1172
CodeBase: file:///C:/Program%20Files/GRIN-Global/GRIN-Global%20Admin/GrinGlobal.Interface.DLL
System.Core
Assembly Version: 3.5.0.0
Win32 Version: 3.5.30729.1 built by: SP
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Core/3.5.0.0__b77a5c561934e089/System.Core.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.
Replicated by me on Win Vista 32 Home - originally seen on workshop XP machines.
Ideally, group should be allowed to be set prior to saving. If not, then the Group tab should not be displayed.
Change History (7)
comment:1 by , 17 years ago
| Status: | new → addressed |
|---|
comment:2 by , 17 years ago
| Status: | addressed → released |
|---|
comment:3 by , 16 years ago
System prompts to save the user before adding groups, but when it attempts to save, gets this error:
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: Incorrect syntax near ':'.
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) in C:\projects\GrinGlobal\GrinGlobal.Core\DataManagers\SqlDataManager.cs:line 268
at GrinGlobal.Core.DataManager.Write(DataCommand cmd, Boolean returnId, String nameOfSequenceOrPrimaryKeyField) in C:\projects\GrinGlobal\GrinGlobal.Core\DataManager.cs:line 1178
at GrinGlobal.Core.DataManager.Write(String procOrSql, Boolean returnId, String nameOfSequenceOrPrimaryKeyField, DataParameters dps) in C:\projects\GrinGlobal\GrinGlobal.Core\DataManager.cs:line 1193
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, String siteCode, String regionCode, String categoryCode, Int32 geographyID, String note) in C:\projects\GrinGlobal\GrinGlobal.Business\SecureData.cs:line 8220
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, String siteCode, String regionCode, String categoryCode, Int32 geographyID, String note) in c:\projects\GrinGlobal\GrinGlobal.Admin\AdminHostProxy.cs:line 512
at GrinGlobal.Admin.ChildForms.frmUser.save() in c:\projects\GrinGlobal\GrinGlobal.Admin\ChildForms\frmUser.cs:line 527
at GrinGlobal.Admin.ChildForms.frmUser.promptToSaveUserIfNeeded(String text) in c:\projects\GrinGlobal\GrinGlobal.Admin\ChildForms\frmUser.cs:line 364
at GrinGlobal.Admin.ChildForms.frmUser.cmiGroupAdd_Click(Object sender, EventArgs e) in c:\projects\GrinGlobal\GrinGlobal.Admin\ChildForms\frmUser.cs:line 767
at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.ToolStripDropDown.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.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.ToolStripDropDown.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)
Field values provided prior to attempting to add a group:
username: rlittle
password: test
Enabled: y
General
Current Cooperator: none chosen
First Name: Rachelle
Last Name: Little
Contact Info
Address Line 1: 1005 NE Kamies Ln
City (presumed): Ankeny
State (presumed): Iowa
Primary phone: 515-451-3473
Email: rachelle@…
comment:4 by , 16 years ago
| Status: | released → addressed |
|---|
(In [1277]) - fixes #413. Bug caused by schema change.
- also fixed a bug in accession trigger which was still looking for site_code field in inventory_maint_policy table. Hasn't appeared yet because testing is happening with a filled database, meaning the default maint_policy record exists (the one this trigger auto-inserts as needed)
comment:6 by , 16 years ago
| Status: | released → verified |
|---|
Verified (officially) in v1.1337.0 (although fixed and released some time ago).
comment:7 by , 16 years ago
| Resolution: | → fixed |
|---|---|
| Status: | verified → closed |

(In [1178]) fixes #413, fixes #414, fixes #415, fixes #416