Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SqlCommandBuilder class
Message
From
14/04/2014 12:05:51
 
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:
01598599
Views:
21
>>>>Try reading again.
>>>>"To generate INSERT, UPDATE, or DELETE statements, the SqlCommandBuilder uses the SelectCommand property to retrieve a required set of metadata automatically. If you change the SelectCommand after the metadata has been retrieved, such as after the first update, you should call the RefreshSchema method to update the metadata."
>>>
>>>I did read this line. However, it doesn't explain why will it use all columns to generate WHERE clause.
>>
>>Dunno, didn't write it. Looks like if's meant to cope with NULL values.
>>
>>> What exactly does required metadata mean?
>>
>>Info on the fields in the Select command.
>>
>>> Why it can not see that PK column I retrieve is a PK column?
>>
>>I thought it did. If I include the PK in the Select command it doesn't generate an update for it in the Update command......
>
>If you use select * from myTable where Pk = @Pk, will your update command include PK column?

No
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform