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) MessageBox.Show(args.Error.Message)
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?
|