Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SqlCommandBuilder class
Message
From
14/04/2014 12:23:15
 
General information
Forum:
ASP.NET
Category:
ADO.NET
Environment versions
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01598513
Message ID:
01598606
Views:
28
>>>If you use select * from myTable where Pk = @Pk, will your update command include PK column?
>>
>>No
>
>Can you show your sample code - looks like I need to set up several properties for this to work the way I need.

This Select command :
SqlDataAdapter da = new SqlDataAdapter("Select Id, CustId,Method FROM SCHeaders WHERE Id=23 ", conn);
generates:
UPDATE [SCHeaders] SET [CustId] = @p1, [Method] = @p2 WHERE (([Id] = @p3) AND ((@p4 = 1 AND [CustId] IS NULL) OR ([CustId] = @p5)) AND ((@p6 = 1 AND [Method] IS NULL) OR ([Method] = @p7)))
Using 'Select *' adds more fields but still doesn't include the PK (Id)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform