New Posts New Posts RSS Feed: Update error
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Update error

 Post Reply Post Reply
Author
Togas View Drop Down
Newbie
Newbie
Avatar

Joined: 26-Jul-2011
Location: Minneapolis
Posts: 11
Post Options Post Options   Quote Togas Quote  Post ReplyReply Direct Link To This Post Topic: Update error
    Posted: 26-Sep-2013 at 6:10am
I have this code which updates my entity any time a field changes:


    Private Sub SaveOrderFromTracking(field As String)
      field = field.Remove(0, 24)
      Dim oldVal As String = CStr(SelectedOrder.EntityAspect.GetValue(field, EntityVersion.Current))
      Dim newVal As String = CStr(SelectedOrder.EntityAspect.GetValue(field))
      Dim OrderId As String = SelectedOrder.EntityAspect.GetValue("OrderId")

      If oldVal = newVal Then Exit Sub

      _mgr.SaveChangesAsync({SelectedOrder}, Nothing, Sub(args)
                                                        If Not args.HasError Then
                                                          Dim newMessage As Message = New Message(OrderId, MsgType.FieldChange, field, oldVal, newVal)
                                                          Messages.Insert(0, newMessage)
                                                        Else
                                                          MessageBox.Show(args.Error.Message)
                                                        End If
                                                      End Sub)
    End Sub


This was working but I added a new field to the table, now I get this error.

The select list for the INSERT statement contains more items than the insert list. The number of SELECT values must match the number of INSERT columns.

I ran a tracer on my SQL server and this is the TSQL being generated:

exec sp_executesql N'update [dbo].[Fastenal_Order]
set [Serial] = @0
where ([OrderId] = @1)
',N'@0 varchar(50),@1 int',@0='test23',@1=1447


Any thoughts on what's going on?
Back to Top
Togas View Drop Down
Newbie
Newbie
Avatar

Joined: 26-Jul-2011
Location: Minneapolis
Posts: 11
Post Options Post Options   Quote Togas Quote  Post ReplyReply Direct Link To This Post Posted: 26-Sep-2013 at 6:27am
So dumb!

There was a trigger on the table, it was using an asterisk.

 


Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down