Results 1 to 4 of 4

Thread: Question on LINQ

  1. #1

    Thread Starter
    Banned timeshifter's Avatar
    Join Date
    Mar 2004
    Location
    at my desk
    Posts
    2,465

    Question on LINQ

    I've been curious about this from the first time I saw it, but never really liked the idea... maybe I just didn't see enough of it to fully understand why it is now in existence.

    First, from what I've seen, it looks more than anything like a way to write database transaction commands inline with the VB code. Is this its' primary role? I can understand why the hobby programmer would like that, but as an ASP.NET developer with a SQL backend, I write all my database transactions in stored procedures in SQL itself, for the speed and for how clean it makes the code. This leaves me little motivation to use LINQ.

    Second, why is the order of directives being thrown around? Every database system that I've worked with has had a similar syntax, some less similar than others, but they all have the same order of directives. Why does LINQ rearrange that?

  2. #2
    Special Guest - Microsoft funkyonex's Avatar
    Join Date
    Dec 2007
    Posts
    12

    Re: Question on LINQ

    Hi timeshifter,

    LINQ is not specific to just querying relational data (like T-SQL or FoxPro), you can query ANY object collection in the .NET framework. You can also use LINQ to query XML (as well as DataSets and SQL server). It's not limited to flat result sets either, it can project object heirarchies as well. LINQ is a much broader set of query operations than what were used to and it's a large subject. Here are some short How-to videos to help get you started: http://msdn2.microsoft.com/en-us/vba...ectionsee#linq

    HTH,
    -B
    Beth Massi, Visual Studio Community
    Visit the Visual Basic Developer Center

  3. #3
    Interweb adm/o/distrator Paul M's Avatar
    Join Date
    Nov 2006
    Location
    Australia, Melbourne
    Posts
    2,306

    Re: Question on LINQ

    Man that "How Do I" video series is excellent

    Nice video to Beth! (#1 Video in VB Section)

  4. #4
    PowerPoster
    Join Date
    Jul 2002
    Location
    Dublin, Ireland
    Posts
    2,148

    Re: Question on LINQ

    Quote Originally Posted by timeshifter
    Second, why is the order of directives being thrown around? Every database system that I've worked with has had a similar syntax, some less similar than others, but they all have the same order of directives. Why does LINQ rearrange that?
    For the second bit the reason is to do with intellisense and compiler determinism...

    when you type:
    SELECT A.

    There is no way to know what list of fields to drop down because we don't know what A is until you type the FROM part.

    This is also why so few database editors have intellisense like operations

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width