SQL To LinQ do you know ?, Sqllinq

Source: Internet
Author: User

SQL To LinQ do you know ?, Sqllinq

You should have used the linQ to SQL tool LinQPad when learning LinQ. It was used at the beginning and is not very familiar with it. What should I do if it involves multi-table queries and does not write a LinQ statement?

This is not a problem. Next we will introduce another tool, SQL to LinQ. SQL has been learned for a long time. It is often used in system development. It should be familiar with SQL statements.

Open SQL Server 2008 and create a new query. I want to match the information in the three tables one by one, and as long as the information of the fields I want, 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])

Run the command to display the fields in the three tables I want:

Then, open SQL to LinQ, Tools -- Linqer Connections, and create a connection:

Select Add:



Set the database to be connected,


Select LinQ to Entities:

Create a file and put it in a folder:


Confirm, copy the SQL statement to the SQL box on the left, select the Connection you just created from the Connection on the top, and execute it. Then the corresponding LinQ statement will be displayed on the right:


Copy the LinQ statement to LinqPad and run:



Perfect !!!, Make good use of tools to improve development efficiency!

Related Article

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.