Run SQL Profiler to see the actual SQL that is being sent to SQL Server.
Very handy tool
Jeff
Thanks, Jeff - I'll try it.
> Run SQL Profiler to see the actual SQL that is being sent to SQL Server.
> Very handy tool
[quoted text clipped - 20 lines]
> >
> > Paul
Jeff-
I'm pasting the Profiler output below. The DataAdapter's table has 12 rows.
Its RowUpdating event fires twice. After the second RowUpdating event the
error occurs, with the "Primary Key" error noted earlier. (The table's
primary key is composed of 3 columns, none of which are being updated. Only
one other column is being updated.)
Only one Update command shows up in the Profiler, corresponding to the first
row of the DataAdapter's table to be updated. The Profiler shows no evidence
of being sent a second row:
-----------------------------------------------------------------------------------
exec sp_executesql N'UPDATE VehicleItems SET ItemID=@ItemID,
ItemSerialNumber=@ItemSerialNumber, PartNumber=@PartNumber,
Description=@Description, Level=@Level,
LevelSortOrder=@LevelSortOrder, ItemSequence=@ItemSequence, Who=@Who,
WhenChanged=@WhenChanged WHERE VehicleId =809',N'@ItemID
int,@ItemSerialNumber nvarchar(20),@PartNumber
nvarchar(50),@Description nvarchar(150),@Level nvarchar(50),@LevelSortOrder
int,@ItemSequence int,@Who nvarchar(50),@WhenChanged
datetime',@ItemID=76,@ItemSerialNumber=N'8084-23',@PartNumber=N'MANUAL',@Description=N'Owner''s
Manual',@Level=N'Robot',@LevelSortOrder=1,@ItemSequence=1,@Who=N'JDB',@WhenChanged=''2006-02-23 11:55:35:000''
> Run SQL Profiler to see the actual SQL that is being sent to SQL Server.
> Very handy tool
[quoted text clipped - 20 lines]
> >
> > Paul