Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SqlCommandBuilder class
Message
 
 
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:
01598610
Views:
25
>>>>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)

In your case, is the ID column an identity column? If yes, then no wonder. In my case it's a numeric(17) column and not identity.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform