Skip to content

LINQ

LINQ (all flavours)

This category can be followed from the open social web via the handle linq-e04cf296@forum.codeproject.com

783 Topics 2.8k Posts
  • Very slow linq preformance

    database help csharp css sql-server
    4
    0 Votes
    4 Posts
    3 Views
    N
    There also other ways to speed up your queries, maybe this will help Entity Framework Performance[^] I know the language. I've read a book. - _Madmatt
  • Type of a query ?

    database question
    3
    0 Votes
    3 Posts
    4 Views
    I
    It is an Anonymous Type containing properties of Number, Type, Table, Price and Date as requested in the final "select new { }" Linq expression. The var keyword was added specifically for this scenario.
  • 0 Votes
    1 Posts
    1 Views
    No one has replied
  • 0 Votes
    3 Posts
    5 Views
    D
    Very nice! Indeed it works with the yield keyword to have the function return objects as long as there are 'descendants'.
  • Query issue

    csharp help question database linq
    3
    0 Votes
    3 Posts
    5 Views
    D
    I was in a hurry and forgt a small detaile in the GetLatestDate method. this is the good GetLatestDate: private DateTime GetLatestDate(List<Prices> prices, Item itm) { DateTime latest = new DateTime(1900, 1, 1); foreach (var price in prices) { if ((price.Date.CompareTo(latest)>0) && (price.ItemID.Equals(itm))) { latest = price.Date; } } return latest; }
  • Linq to XML speed vs MySql speed

    performance csharp database mysql visual-studio
    4
    0 Votes
    4 Posts
    2 Views
    D
    " I have a fairly big XML database here and was wondering if I might get better performance by loading it into MySql." If I unterstood well, you want to "load" the xml file into MySQL witch means reading it and then loading it into the DB. If this is the case then it makes no sense. Just load it and LINQ it. If you want to give up the XML and use the DB taht's a totally different thing and it will be faster(a lot faster) especially for large amounts of data.
  • Except Confusion

    question
    6
    0 Votes
    6 Posts
    2 Views
    B
    I am new to vb.net and LINQ. I do not understand what you understand when you said: "If I have 2 Lists of ints say ds1 and ds2 and in ds1 I put {1,1,2} and in ds2 I put {2} and then I use var except = ds1.Except(ds2) , except will contain only {1}. This I understand." I expected except to contain {1,1}. Please explain. What I am trying to do is this. Read a text file, exclude a group of words from the file and then use regex and linq to choose the words (maybe all words longer than 6 letters) count number of uses of a word and to group and order the output. Everything is working fine except the exclusion of words. I thought Except was the answer, but was very surprised to see that it removed duplicates from the target string. Any suggestions will be appreciated. Bill:confused:
  • convert graph into xml

    csharp linq mcp data-structures xml
    1
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • 0 Votes
    3 Posts
    3 Views
    J
    I run into the same issue today, I solved it by calling dataset.AcceptChanges(); :)
  • How to Fill Directly a DataTable using LINQ

    csharp database linq help tutorial
    3
    0 Votes
    3 Posts
    2 Views
    P
    I blogged about a DataSet/DataTable extension for Linq here[^]. "WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes. My blog | My articles | MoXAML PowerToys | Onyx
  • 0 Votes
    3 Posts
    2 Views
    S
    I can't understand how it works. Can you tell me where to find an example? Thanks, Silvia
  • Linq related tables

    csharp database sql-server linq sysadmin
    3
    0 Votes
    3 Posts
    3 Views
    E
    That simple?? You for president!! Thanks! .: I love it when a plan comes together :. http://www.zonderpunt.nl
  • How to use DbLinq that suport Linq To Oracle?

    help csharp oracle linq tutorial
    2
    0 Votes
    2 Posts
    3 Views
    S
    Oracle is Not supported!
  • sharepoint [modified]

    sharepoint tutorial
    2
    0 Votes
    2 Posts
    2 Views
    L
    Try the Sharepoint forum.
  • multiple data sources

    csharp css database mysql oracle
    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • convert IQueryable to List&lt;&gt;

    database linq help
    2
    0 Votes
    2 Posts
    2 Views
    P
    Use the ToList(); extension method. "WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes. My blog | My articles | MoXAML PowerToys | Onyx
  • seperate DTO's

    csharp database linq mcp
    2
    0 Votes
    2 Posts
    4 Views
    S
    The way I used to do it w/ LINQ2SQL is to generate an interface on the table, for each table class in the datacontext. I would then manually go through each interface and convert it to a class. I'm not sure if someone has figured out how to automate this. After a year of so, I bought a commercial ORM from Mindscape called Lightspeed, it supports linq and generates the DTOs for me =)
  • Linq to validate data table

    csharp linq
    2
    0 Votes
    2 Posts
    3 Views
    D
    IMO this[^] is a must visit for anyone starting with LINQ. 50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
  • Sequental access issue

    csharp linq design mcp sales
    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • list issue

    database csharp mcp help question
    2
    0 Votes
    2 Posts
    3 Views
    P
    You only should get the foreign key of tableb! according to your example... unless you've selected some data of tableb like result.tableb.fieldOfTableB <--- this automatically makes a join in your query! ;)