SQL to LinQ you know what?

Source: Internet
Author: User

when you learn LINQ, you should use LINQ to SQL tools---linqpad, just starting with, not quite familiar with, especially when it comes to multi-table queries, not writing LINQ statements?

This is not a problem, let's first introduce another tool SQL to Linq,sql has been learning for a long time, do the system often used, for SQL statements should be familiar with it.

Open SQL Server 2008, create a new query, I want to match the information in three tables to one by one, and as long as I want the information of the field, the SQL statement:  

SELECT [T2]. [Virtualexamroomid], [T2]. [Virtualexamroomname], [t0]. [Examid], [t0]. [Examname], [T1]. [Examineeexamid], [T1]. [Examineename] From [examexamentity] as [t0], [examexamineeexamentity] as [T1], [examexamroomplanentity] as [T2]where ([t0].[ Examid] = [T1]. [Examexamentityexamid]) and ([t1].[ Examexamroomplanentityvirtualexamroomid] = [T2]. [Virtualexamroomid])

Execute, display the relevant field information in the three tables I want:

Then, open SQL to Linq,tools--linqer Connections, and create a new connection:

Select Add:



Set up the database to connect to,


Select LINQ to Entities:

To create a new file, place it under one of the following folders:


confirm, copy the SQL statement to the left SQL box, select the connection you just created in the upper connection, execute it, and then the right side will display the corresponding LINQ statement:


copy the LINQ statement to LINQPad and run:



perfect!!! , use tools, improve development efficiency!

SQL to LinQ you know what?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.