In a lot of the tutorials online for learning LINQ, they use a NorthwindDataContext. From where is this retrieved/generated?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Northwind was a demo database that got replaced by AdventureWorks. It was available for SQL Server and MS Access.
When you want to use Linq to SQL, you need a DataContext to query against. You can create this by adding a new Linq To Sql class to your solution. Once you’ve done that, you get a design surface. Open the ‘Server Explorer’ window and connect to your Northwind database. Drag the tables of interest on to your L2S design surface and save. This will generate the NorthwindDatacontext and associated table classes for you to use in your query.