2

I have a DataTable, and need to extract the data by using this SQL query:

SELECT code_direction, count(TP) AS CN FROM table1 WHERE cod_time = 'A011' GROUP BY TP,code_direction; 

Which is the C# LINQ equivalent query? After it I want to move the results into a new DataTable.

I tried many examples founded around in web but no this specific logic.

1

1 Answer 1

1

Linqer is your friend!

This tool can translate SQL to LINQ. You can download it at http://www.sqltolinq.com.

Note that it's not always possible to convert a SQL query straight into a 100% equivalent LINQ query, but it should be close enough.

If you need translation in the other direction -- from LINQ to SQL -- you can use LINQPad. Download it at http://www.linqpad.net/.

Sign up to request clarification or add additional context in comments.

2 Comments

Has Linqer resolved their virus warnings? stackoverflow.com/questions/296972/sql-to-linq-tool
It appears they have. Just downloaded it and ran it and NAV Corporate installed on my machine didn't complain. He's apparently been fighting this for a while. Seems that it was due to a compression tool he was using? sqltolinq.proboards.com/…

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.