Quantcast
Channel: BlogoSfera » linq
Browsing all 14 articles
Browse latest View live

linq select parent element from xml based on multiple child element

How to select a <client> element where <domain> contains any specified value : <config> <client> <name>Localhost</name> <domains>...

View Article



FindAll Vs Where [duplicate]

This question already has an answer here: LINQ, Where() vs FindAll() 4 answers I have an IEnumerable<T> that I wanted to filter based on a LINQ predicate. I tried using Where on the IEnumerable...

View Article

Trying to query many text files in the same folder with linq

I need to search a folder containing csv files. The records i’m interested in have 3 fields: Rec, Country and Year. My job is to search the files and see if any of the files has records for more then a...

View Article

LINQ result to object initializer

I have a problem with converting linq result to object. I have a class called Plant and a database which contains information about it (for example name, latin name, habitats etc). i want to create a...

View Article

Concatenate two string using LINQ

I want the output as the below string format using LINQ. [“providerZip”,”providerType”] Can anyone please tell me, how to concatenate the two string using LINQ? The post Concatenate two string using...

View Article


LINQ sum of one column and insert to another table C#

i have two tables suck as the one below i wanna know how to sum “calorie” column based on name from table 1 and then insert the value to table 2...

View Article

Is there a Match like syntax for LINQ

Here is a case I’m trying to solve elegantly. Let’s say I have an enumerable (and it might be a rather large enumerable that I’d prefer to enumerate only once). Let’s say also that I have specific...

View Article

Joining clause in linq

I’ve created three table’s name: emps, emp_project, emp_location now i want to select one column from each table, but when im executing join query so far getting this this error: The type of one of the...

View Article


Read all the values in a node in xml with key value pairand print them in...

I have an XML file with key/value pairs. XML file which I am using: <?xml version="1.0" encoding="UTF-8"?> <MAN_J6_Variant> <play_music_media_HK> <key name ="Media_Press"...

View Article


Cannot implicitly convert type System.Linq.IQueryable to System...

I have this linq query which will select all the records in my table InventoryLocation. however it gives me an error… I dunno what is the problem… I’m really new to this so bear with me… Error Cannot...

View Article

how do I make this LINQ query faster?

modelData has 100,000 items in the list. I am doing 2 “Selects” within 2 loops. Could it be structured differently – as it take a long time – 10 mins public class ModelData { public string name; public...

View Article

Using lambdas LINQ query in C#

I am still in the midst of converting our web app from vb to C# and this complex query, that I just finished converting and have tested and it works properly, needs refactoring. This section could...

View Article

More graceful solution to nested Linq queries?

I have a set of nested linq queries that are used to get a property from a list of properties. It works great as-is, but it has one caveat. I have to put in error handling just in-case there isn’t a...

View Article


linq query on list id’s

I have a list of id’s and I need to get all records correscponding to each id in the list . below is the sample code public List<Items> LoadLineItemByPkeys(IEnumerable<long> ItemId) { var...

View Article
Browsing all 14 articles
Browse latest View live




Latest Images