Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
How to: Directly Execute SQL Commands

How to: Directly Execute SQL Commands (LINQ to SQL)

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");

Community Additions

ADD
Show:
© 2015 Microsoft