Questions tagged [linq-query-syntax]

Language-Integrated Query is the name for a set of technologies based on the integration of query capabilities directly into the C# language.

Language-Integrated Query (LINQ) is the name for a set of technologies based on the integration of query capabilities directly into the C# language. Traditionally, queries against data are expressed as simple strings without type checking at compile time or IntelliSense support. Furthermore, you have to learn a different query language for each type of data source: SQL databases, XML documents, various Web services, and so on. With LINQ, a query is a first-class language construct, just like classes, methods, events.

Full Overview: https://docs.microsoft.com/en-us/dotnet/csharp/linq/index

88 questions
0
votes
1 answer

Algorithm to create batches of Files

I have one directory where all files with their different version are available. Like, ABC.pdf ABC_1.pdf ....... XYZ.tif ..... XYZ_25.tif MNO.tiff I want to make n batches of m files as per used requirement. Suppose, in folder I have ABC.pdf to…
sapatelbaps
  • 416
  • 2
  • 7
  • 18
0
votes
2 answers

Hash checking method in where clause MongoDB and LINQ

I have the collection that contains images and DCT hash for their. How I can select only similar images using Similarity(long hash, long hashOther) method in LINQ where clause. This query is not work: var results =…
Nodir
  • 261
  • 1
  • 2
  • 16
0
votes
2 answers

Get Top x Products using Linq

I need to get the Top 10 records using Linq to Entities. I need to bind the returned result into a GridView as follows" Product Name | Product Description | Number of Items Sold Item 1 | Item 1 Description | 24 As per…
ClaireG
  • 1,214
  • 2
  • 10
  • 22
0
votes
0 answers

How to apply conditionally Where Clause in LinQ Query

I have 5 text box like txtbox1,txtbox2,txtbox3,txtbox4,txtbox5 and 4 dropdown control having value AND & OR. Now control arrangements are like txtbox1, dropdown1, txtbox2, dropdown2, txtbox3,....txtbox5. txtbox2 & txtbox5 having Integer value.…
0
votes
2 answers

Does LINQ "Query Syntax" Support Duck Typing?

Regarding LINQ query syntax... var foo = new List { 1, 2 }; var boo = from n in foo where n > 1 select n; ...I always thought this syntax was limited to operating on IEnumerable. Or at least until I learned about…
Brent Arias
  • 26,187
  • 32
  • 120
  • 209
0
votes
2 answers

Linq query where clause returning null

This is the XML File I am trying to get the tag Element Posted_Status where Posted_Status has Ready <---Network is the parent element
shawn
  • 133
  • 1
  • 1
  • 12
0
votes
3 answers

Aggregate distinct count in LINQ - VB.NET

I have a data that is comming from the database and going into PagedDataSource. The data is from a query which pull some 10 records with some 20 column. Based on one varchar column name `source', I want to find unique instances of the source. This…
Hammad Khan
  • 14,008
  • 14
  • 100
  • 123
0
votes
3 answers

LINQ Error when using multiple JOIN in same statement on CRM 2011 Plug-in

Hi I am trying to join multiple entities in CRM 2011 but I get and error saying: {"'xrmsm_sessionEnrollments' entity doesn't contain attribute with Name = 'xrmsm_termsid'."}. That is correct but I am joining the entity that have that attribute. My…
0
votes
1 answer

Linq query help

I'm attempting to write a linq query which uses several tables of related data and have gotten stuck. The expected result: I need to return the three most populous metropolitan areas per region by population descending. tables w/sample…
jas
  • 529
  • 1
  • 5
  • 10
0
votes
3 answers

Linq Nested Inner Joins

I want to join the following Tables 1. B_Book[1st Table] -B_BID (Book ID)(PK) -B_Name -B_CategroyID (FK) 2. BI_BookInstance [2nd Table] -BI_IID(Instance ID) -BI_BID (FK) -BI_Price 3. BC_BookCategory [3rd Table] …
-1
votes
1 answer

why am i getting a sql query when i try to get a property of an entity?

I am trying to get the value of properties of this entity (this entity is inside the list "trabajadores"), but I ended up getting a "sql query" in "CodCar" property when it is supposed to give me a value. It doesn't happen with other properties of…
Walter
  • 69
  • 1
  • 12
-1
votes
1 answer

How to get multiple value in Array from linqQuery from foreach loop?

Hi I want to get result of my query in Array which is executed in foreach loop,i have my custom class but whenever I try to save it in variable it shows error : it is not possible to convert genriccustom class to my custom class var userName =…
Anshul Khare
  • 139
  • 1
  • 2
  • 12
-1
votes
2 answers

How to convert Linq query to SQL query

I am not be able to understand that All function functionality in below code and i just want to write SQL stored procedure for this below query.. IQueryable situations = db.Situations .Include("SituationHandicap") …
1 2 3 4 5
6