in

Dot Net Mafia

Group site for developer blogs dealing with (usually) .NET, SharePoint, Office 365, Mobile Development, and other Microsoft products, as well as some discussion of general programming related concepts.
All Tags » LINQ (RSS)

Browse by Tags

  • Checking for empty EnumerableRowCollections when using LINQ

    After you query something with LINQ, you may want to know if any results were returned before your start enumerating or working with the EnumerableRowCollection (that's most likely the type behind that var you are using in most cases). Consider the following example. DataTable myDataTable = new DataTable...
    Posted to Corey Roth [MVP] (Weblog) by CoreyRoth on 04-24-2008
  • Linq to SQL and linked tables

    There are several articles about how to do this, but none of them seem to reflect the kind of situations we encounter in the real world. They all seem to revolve around the same tables in the Adventure Works database, and they give you glimpses of "What" rather than "How." Oh, and...
    Posted to Not Necessarily Dot Net (Weblog) by JamesAshley on 04-07-2008
  • Linq to SQL and enums

    This is really stupid, but it seems like enough of a stupid niche problem that it might be worth mentioning. There's an integer column in a database that maps to an enum. Whenever I tried to mark that enum as a column, I got an InvalidCastException (from deep within the Linq reflection-magic call...
    Posted to Not Necessarily Dot Net (Weblog) by JamesAshley on 03-27-2008
  • How to: Use the Group Clause in LINQ

    As you know, LINQ is similar in a lot of ways to T-SQL, but as you go to start doing things with grouping or joining, you will find that that there are some syntactical differences. There are two ways you can use the group clause in LINQ, which way you will use it will be based upon your particular needs...
    Posted to Corey Roth [MVP] (Weblog) by CoreyRoth on 03-26-2008
  • Using LINQ to make Enterprise Search Results more usable

    In my previous post about using the KeywordQuery class, I had one small omission. The fact is that when you add your own managed properties using the SelectProperties collection of the keyword class, the data type you get back is a string[] containing 1 element instead of a string. This can be quite...
    Posted to Corey Roth [MVP] (Weblog) by CoreyRoth on 03-25-2008
  • How to: Use LINQ to SQL without using the Object Relational Designer

    LINQ to SQL has already proved to be extremely easy to use to create object relational mappings when you have an existing database schema using the Object Relational Designer. This designer is good, but you may not want something that is autogenerating your domain classes. You may want to generate your...
    Posted to Corey Roth [MVP] (Weblog) by CoreyRoth on 03-17-2008
  • LINQ to SQL Logging

    The other day I was reading Charlie Calvert's excellent post on LINQ and Deferred Execution and stumbled upon a logging feature inside LINQ to SQL. By setting the Log property to a TextWriter (in this case Console.Out), LINQ to SQL will log the query and what parameters it sent to the database server...
    Posted to Corey Roth [MVP] (Weblog) by CoreyRoth on 02-21-2008
  • Making DataSets tolerable using LINQ to DataSet

    Unfortunately, most of us aren't working in a perfect world, so it is bound to happen that you run into a dataset or two. Whatever the reason (the developer was lazy, you're maintaining legacy code, someone didn't know any better, or you're just working with the SharePoint API), it would...
    Posted to Corey Roth [MVP] (Weblog) by CoreyRoth on 02-18-2008
  • How I used LINQ to XML to Create Document Library Folders

    I have been doing a lot of document library work lately and in my work I had a need to create a series of subfolders in the document library using a particular custom content type. This meant I was going to need to write a little code. I decided to keep the list of folders i needed to create in an XML...
    Posted to Corey Roth [MVP] (Weblog) by Anonymous on 01-17-2008
Page 2 of 2 (19 items) < Previous 1 2
2015 dotnetmafia.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems