From the course: LINQPad Essential Training
Unlock this course with a free trial
Join today to access over 22,400 courses taught by industry experts.
Query the database with SQL - LINQ Tutorial
From the course: LINQPad Essential Training
Query the database with SQL
- [Narrator] Now that we have an active connection to the database we can use it in any query window. So here's how you would do this. Create a new query by clicking on the plus sign and then I want to write some SQL, so I'll choose this SQL editor, and then I'll look for my active connection and choose it here, and now I can start writing my SQL in this window. I'll work with one of these tables, remember that you can open the connection and look at the table names. So I want to get all the products, so I'll say select star from products and press alt 5 on the query. I get back 77 rows, and about 11 columns of data here. So let's limit the columns. I'll use product name and unit price. Now to see those names on the column names you can expand the table and see the column definitions. So I'm looking for product name and unit price, and since they have spaces in them, I'll need square brackets. So I'll replace this…
Contents
-
-
-
-
-
-
What sources are valid for LINQ to Objects1m 21s
-
Basic LINQ query operators2m 3s
-
Write LINQ query expressions1m 49s
-
Connect to a database2m 9s
-
Query the database with SQL1m 37s
-
Use the DataContext1m 47s
-
Query the database with a LINQ expression2m 34s
-
Configure an XML file as a data source2m 35s
-
Query the XML file1m 8s
-
Filter by attributes54s
-
-
-
-
-
-
-