Export (0) Print
Expand All
0 out of 1 rated this helpful - Rate this topic

How to: Directly Execute SQL Commands

Assuming a DataContext connection, you can use ExecuteCommand to execute SQL commands that do not return objects.

The following example causes SQL Server to increase UnitPrice by 1.00.

db.ExecuteCommand("UPDATE Products SET UnitPrice = UnitPrice + 1.00");
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft. All rights reserved.