May 2010
Intermediate to advanced
1272 pages
61h 18m
English
ObjectContextThe first task you need to accomplish when working with the ADO.NET Entity Framework in code to get an instance of the ObjectContext class. At the beginning of this chapter I told you to create a new Visual Basic project for the Console, so let’s continue on this path. At module level (or class level, in most common scenarios) declare a variable of type NorthwindEntities that represents our object context as follows:
Private northwindContext As NorthwindEntities
Within the Sub Main (or in the constructor if you work with classes), create the actual instance:

Notice how a System.Data.SqlClient.SqlException general ...
Read now
Unlock full access