The EntitySpaces Community

Share and learn about the EntitySpaces Architecture.
Welcome to The EntitySpaces Community Sign in | Join | Help
in
Home Forums Photos

Incorrect syntax near the keyword 'WHERE'.

Last post 06-28-2007, 2:01 PM by David.Parsons. 1 replies.
Sort Posts: Previous Next
  •  06-28-2007, 1:28 PM 3437

    Incorrect syntax near the keyword 'WHERE'.

    I have a detail grid, in which I change one of the values of a field that is in the primary key (no duplicate is created). When I do so I get the error

    "Incorrect syntax near the keyword 'WHERE'."

    EntitySpaces Version # 2007.0.0528.0

     The code that triggers the message is the Save() method.

    Code:
                    ultraGridUserCustLocations.UpdateData();
                    if (userCustomerLocationsCollection1.IsDirty)
                    {
                        userCustomerLocationsCollection1.Save();
                    }

    I can add & delete records in the same grid

    If I use Watch and look at this variable

    ((EntitySpaces.Interfaces.esDynamicQuery)(userCustomerLocationsCollection1.Query)).es.LastQuery

    I see this value

    SELECT * FROM [UserCustomerLocations] WHERE ([UserId] = @UserId1 )

    Any ideas? Need any more info.

    Code:
    Stack Trace
    
       at EntitySpaces.Core.esEntityCollection.SaveToProviderInsertsUpdates(esSqlAccessType sqlAccessType)
       at EntitySpaces.Core.esEntityCollection.SaveToProvider(esSqlAccessType sqlAccessType)
       at EntitySpaces.Core.esEntityCollection.Save(esSqlAccessType sqlAccessType)
       at EntitySpaces.Core.esEntityCollection.Save()
       at Logistics.frmUsers.CheckUserCustLocationDataRow() in C:\Development\Customers\TRNJ\Logistics\Logistics\frmUsers.cs:line 174
       at Logistics.frmUsers.ultraGridUserCustLocations_BeforeRowDeactivate(Object sender, CancelEventArgs e) in C:\Development\Customers\TRNJ\Logistics\Logistics\frmUsers.cs:line 125
       at Infragistics.Win.UltraWinGrid.UltraGrid.OnBeforeRowDeactivate(CancelEventArgs e)
       at Infragistics.Win.UltraWinGrid.UltraGrid.FireEvent(GridEventIds id, EventArgs e)
       at Infragistics.Win.UltraWinGrid.UltraGrid.OnActiveRowCleared(Boolean update)
       at Infragistics.Win.UltraWinGrid.UltraGridBase.SetActiveRow(UltraGridRow row, Boolean scrollIntoView)
       at Infragistics.Win.UltraWinGrid.UltraGridCell.Activate()
       at Infragistics.Win.UltraWinGrid.UltraGridCell.SetFocusAndActivate(Boolean byMouse, Boolean enterEditMode, Boolean byTabKey)
       at Infragistics.Win.UltraWinGrid.UltraGridCell.SetFocusAndActivate(Boolean byMouse, Boolean enterEditMode)
       at Infragistics.Win.UltraWinGrid.CellUIElementBase.OnEmbeddableElementMouseDown(Object sender, EmbeddableMouseDownEventArgs e)
       at Infragistics.Win.UltraWinGrid.GridEmbeddableEditorOwnerInfoBase.OnEditorMouseDown(EmbeddableUIElementBase embeddableElem, EmbeddableMouseDownEventArgs e)
       at Infragistics.Win.EmbeddableUIElementBase.RaiseMouseDownEvent(EmbeddableMouseDownEventArgs e)
       at Infragistics.Win.EmbeddableUIElementBase.OnMouseDown(EmbeddableMouseDownEventArgs e, Boolean adjustableArea, UIElement& captureMouseForElement)
       at Infragistics.Win.EditorWithTextUIElement.OnMouseDown(MouseEventArgs e, Boolean adjustableArea, UIElement& captureMouseForElement)
       at Infragistics.Win.UIElement.OnMouseDown(MouseEventArgs e, Boolean adjustableArea, UIElement& captureMouseForElement)
       at Infragistics.Win.TextUIElementBase.OnMouseDown(MouseEventArgs e, Boolean adjustableArea, UIElement& captureMouseForElement)
       at Infragistics.Win.EditorWithTextDisplayTextUIElement.OnMouseDown(MouseEventArgs e, Boolean adjustableArea, UIElement& captureMouseForElement)
       at Infragistics.Win.ControlUIElementBase.ProcessMouseDownHelper(Object sender, MouseEventArgs e)
       at Infragistics.Win.ControlUIElementBase.ProcessMouseDown(Object sender, MouseEventArgs e)
       at Infragistics.Win.Utilities.ProcessEvent(Control control, ProcessEvent eventToProcess, EventArgs e)
       at Infragistics.Win.UltraControlBase.OnMouseDown(MouseEventArgs e)
       at System.Windows.Forms.Control.WmMouseDown(Message& m, MouseButtons button, Int32 clicks)
       at System.Windows.Forms.Control.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)
  •  06-28-2007, 2:01 PM 3440 in reply to 3437

    Re: Incorrect syntax near the keyword 'WHERE'.

    EntitySpaces, by design, does not support updating primary keys.

    http://community.entityspaces.net/forums/thread/441.aspx
    http://community.entityspaces.net/forums/thread/2974.aspx


    David Neal Parsons
    www.entityspaces.net
View as RSS news feed in XML