• Improve performance in linq query 2019-01-22

    We have a linq query as shown below to display items first it should display records matching with the text and next with if the text contains in the string.But it is causing lot of performance issue. Could any one pls help how to improve it. Dim res

    Tags: linq,
  • LINQ pad is showing SUM at end of result

    LINQ pad is showing SUM at end of result 2018-12-23

    When i run the below query by LINQ PAD then saw it was showing sum at the end of result. here is the full code and it is working. void Main() { var csvlines = File.ReadAllLines(@"M:\smdr(backup08-06-2015).csv"); var csvLinesData = csvlines.Skip(

    Tags: linq, linqpad
  • LINQ Group By and not contains usage issue 2018-12-11

    i like to eliminate those user data which start with VM & Voice Mail var csvlines = File.ReadAllLines(@"M:\smdr(backup08-06-2015).csv"); var csvLinesData = csvlines.Skip(1).Select(l => l.Split(',').ToArray()); var groupOfUser = from line

    Tags: linq
  • Iterating through a list of elements inside an element with a specific index 2018-11-12

    I have an XML-document that I'm trying to extract data from. <folder> <list index="1"> <item index="1" > <field type="IMAGE"> <url></url> </field> </it

    Tags: linq, xml, xpath
  • LINQ GroupBy() by the different algorithm 2018-10-20

    I need to group data for get a different results by condition My entity is: public class MyTestCollection { public Int32 Id { get; set; } public List<MyTestItem> Tests { get; set; } } public class MyTestItem { public long Id { get; set; } public Lis

    Tags: linq
  • Use linq to map parent child structure 2018-10-04

    I have the domain classes separated from the ones I use in the views, so when retrieving data I have to map the domain classes to the view ones. Until now this have been straight forward, but now I have a case in which I need to map parent-child clas

    Tags: linq
  • Except not working when rows are added using ImportRow() 2018-09-17

    I have a main DataTable called dt and two other DataTables called successBatch and failBatch. The latter two are created as Clones of the main one. I would like to remove all the DataRows that are inside successBatch and failBatch from dt. This used

    Tags: linq, datatable
  • Create complex json from datatable c# 2018-09-13

    I have 3 datatables in my dataset. Table A has one to many relationship with B and C. I want to create Json like below using Linq in c#. Can someone please help me? I would like to thanks in advance to everyone who will guide me or provide me input t

    Tags: javascript, linq, json, datatables
  • C# Linq double groupby need min/max for hourly values once per day 2018-06-12

    I have been playing around with this for awhile now and can't quite get the result I am looking for. I have an object like this: public class Point { public string Tag {get;set;} public DateTime Time {get;set;} public int Value {get;set;} } Each tag

    Tags: linq, date
  • How to force Entity Framework to produce more efficient SQL code? 2018-06-10

    We are using EF 6.1. Despite the improvements from v4, there is often need to help EF in the decision on how to generate SQL to be more efficient. Usually helps to use LINQ in our case and specify joins. However, now I have a case where I don't know

    Tags: optimization, sql, linq, entity framework
  • How to make async with linq 2018-06-05

    i'm trying to make my first web application with mvc including remote database with linq. So i'm using default template from mvc, i've remade code in AccountController that implement register users with using linq, and now i'm interesting do

    Tags:, linq, mvc, asynchronous
  • LINQ C# Creating Dictionary of Dictionaries using GroupBy 2018-04-30

    I can't seem to find a solution to this, and the error message is not very helpful. I have a DataTable: iGuid, iDateTime, iDecimal I want to create a Dictionary of Dictionaries, such that... iGuid -> iDateTime -> iDecimal. For example. Guid1, Monday

    Tags: linq, dictionary
  • @html.dropdownlistfor shows both value and text but has no value set 2018-04-30

    I am getting a dictionary from an object: property.PropertyContacts = db.Users .Select(t => new { Value = t.UserId.ToString(), Text = t.LastName + " " + t.FirstName }) .AsEnumerable() .ToDictionary(t => t.Value, t => t.Text); Passing it

    Tags: linq, dropdownlistfor
  • Linq - Get items from the list based on "weight" and "order" 2018-02-15

    I am trying to create a class which compute the completeness of a profile of a user and I am trying to get the next steps (Evaluators) in order for the user to achieve the next completeness level. public class Evaluator { public Evaluator(string name

    Tags: linq, linq to sql, lambda
  • The best way to Complex query in linq 2018-02-07

    The best way to change below in Linq Lamda Category will be unique across Location to its base location. And I should load the category of immediate location first. If there is no category with that name then should load its immediate parent. Also I

    Tags: linq
  • Filter data in kendo dropdownlist 2017-12-24

    I want to ask you a question about filtering data from 2 dropdownlist. First, I have a dropdownlist that contains 2 types of Persons "Phisic" and "natural" and another one that contains the gender of person "Unknown","fe

    Tags: linq, kendo ui
  • How to build batches/buckets with linq 2017-12-19

    I need to create batches from a lazy enumerable with following requirements: Memory friendly: items must be lazy loaded even within each batch (IEnumerable<IEnumerable<T>>, excludes solution building arrays) the solution must not enumerate twi

    Tags: linq, group by, batch processing, bucket
  • Linq Predicate And and Predicate Or to sql conversion 2017-12-14

    LINQ library has a predicate "and" and predicate "or" functionality that works as below. There are two questions that i would like to ask: How would the following LINQ statement be when being translated or written in SQL? Is there a st

    Tags: sql, linq
  • Create a list of Missing Numbers(integers) using C# 2017-12-09

    I want to create a list of Missing numbers between 1 and 7000. My list contains numbers like 1,2,3,4,5,6....upto 80 100, 101, 102, 103....upto 130 200, 201, 202, 203, 204...upto 250 In this case, I want to create from 81 to 99 and 131 to 199 and 251

    Tags: linq, list
  • Get unmatched records by comparing datatables in c# 2017-12-06

    I want to get the unmatched records by comparing two DataTables eg : Table 1 TransID BookingID BookingStatus BookingType 1 11 Y Paid 2 12 N UnPaid 3 13 N Paid Table 1 TransID BookingID BookingStatus BookingType 1 11 Y Paid 2 12 Y UnPaid 4 14 Y Paid I

    Tags: linq, datatable

Copyright (C), All Rights Reserved.

processed in 2.820 (s). 9 q(s)