About 2,460,000 results
Open links in new tab
  1. How to view LINQ Generated SQL statements? - Stack Overflow

    Feb 4, 2011 · If you use SQL profiler, to ensure capture of all LINQ queries from your VS debug session, use SQL Profiler 'RPC Completed' and 'SQL:BatchCompleted' events. – Iomm1 Commented Sep 24, 2018 at 9:11

  2. c# - Get SQL query from LINQ to SQL? - Stack Overflow

    Aug 14, 2013 · Incidentally, LINQ to SQL is not entity framework. If the former, you can set [yourDataContext].Log = Console.Out (or some other stream writer ) and get the query. In the query you have, consider writing it as follows to be able to do the ToString trick:

  3. Linq to SQL how to do "where [column] in (list of values)"

    Aug 29, 2015 · @PersyJack LINQ to SQL generates the T-SQL query, which then runs on the SQL Server using the database settings for case-sensitivity. Although, if one is not careful, and materializes the query results, before applying LINQ to in-memory objects, they may suffer the consequences of mismatched case-sensitivity.

  4. LinqPad - Convert SQL to Linq command - Stack Overflow

    Jan 19, 2020 · Linqpad does have a really nice translation of the Linq query to SQL (although it does so using the .Net Linq-to-SQL library, so your mileage may vary). I've found it does a great job of educating those just starting on Linq but familiar with SQL as well as verifying that what I wrote in Linq is producing results analogous to a SQL query. –

  5. LINQ Where with AND OR condition - Stack Overflow

    Jan 11, 2016 · Linq to SQL multiple conditional where clauses. 1. Linq multplie where query with or operator. 0. linq ...

  6. Linq version of SQL "IN" statement - Stack Overflow

    This Linq query is the same as the following SQL: SELECT Items.* FROM TagMaps INNER JOIN Items ON Item.ItemId = TagMap.ItemId WHERE TagMaps.TagId IN (12,32,24) Linq takes care of the INNER JOIN part for you, because it knows how to go from TagMap to Item.

  7. c# - Proper LINQ where clauses - Stack Overflow

    Apr 27, 2015 · When this is a linq-to-object call, multiple where clauses will lead to a chain of IEnumerables that read from each other. Using the single-clause form will help performance here. When the underlying provider translates it into a SQL statement, the chances are good that both variants will create the same statement.

  8. What is the syntax for an inner join in LINQ to SQL?

    Sep 1, 2008 · To extend the expression chain syntax answer by Clever Human:. If you wanted to do things (like filter or select) on fields from both tables being joined together -- instead on just one of those two tables -- you could create a new object in the lambda expression of the final parameter to the Join method incorporating both of those tables, for example:

  9. c# - If Else in LINQ - Stack Overflow

    Jun 2, 2011 · Is it possible to use If Else conditional in a LINQ query? Something like from p in db.products if p.price>0 select new { Owner=from q in db.Users select q.Name } else select new {

  10. c# - Linq-to-SQL Timeout - Stack Overflow

    Jan 23, 2012 · Linq to SQL: Query runs fine in SQL Server Management Studio, but times out on the application. Related ...

Refresh