From the course: LINQPad Essential Training
Unlock this course with a free trial
Join today to access over 22,600 courses taught by industry experts.
Connect to a database - LINQ Tutorial
From the course: LINQPad Essential Training
Connect to a database
- [Instructor] LINQPad supports working with databases. Let's see how to set up a connection. All the connections are shown on the left, I've got one active connection setup, we're connected to the DemoDB.sdf database. This is a sample database that is installed with LINQPad. An SDF file contains a compact relational database saved in the Microsoft SQL Server Compact format. To add your own connection, click on this link. This first screen is where you set up the data context. LINQPad uses the data context for each database. Essentially, that means that each table and stored procedure in the database, are alias to a .NET class, think of this as an object-relational mapper, also known as an ORM. So I've got two choices here, I can have LINQPad create the data context for me, and there's two options how generate those classes. Or if I've already got my own type data context set up in a .NET assembly, I can choose it in this…
Contents
-
-
-
-
-
-
(Locked)
What sources are valid for LINQ to Objects1m 21s
-
(Locked)
Basic LINQ query operators2m 3s
-
(Locked)
Write LINQ query expressions1m 49s
-
(Locked)
Connect to a database2m 9s
-
(Locked)
Query the database with SQL1m 37s
-
Use the DataContext1m 47s
-
(Locked)
Query the database with a LINQ expression2m 34s
-
(Locked)
Configure an XML file as a data source2m 35s
-
(Locked)
Query the XML file1m 8s
-
(Locked)
Filter by attributes54s
-
(Locked)
-
-
-
-
-
-