O'Reilly logo

Microsoft® Visual Basic® 2010 Developer’s Handbook by Klaus Löffelmann and Sarika Calla Purohit

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Executing T-SQL Commands Directly in the Object Context

As you saw in the sample project LinqToEntitiesDemo, with the ADO.NET Entity Framework, you can use T-SQL commands directly, sending them to SQL Server for execution. For example, the method LinqToEntitiesDemo disables the trigger on the Vendor table by using the following T-SQL statement:

awContext.ExecuteStoreCommand("disable trigger Purchasing.dVendor on Purchasing.Vendor")

Important

When using T-SQL commands directly, you lose one of the great advantages of the Entity Framework—separation of the conceptual data model from the database. Using T-SQL statements directly can compromise your application’s compatibility with other databases.

Entity Framework 4.0 adds some new methods to the object ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required