CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Linq to sql

  1. #1
    Join Date
    Aug 2010
    Posts
    20

    Linq to sql

    Hi everyone
    I try to get a data from MySql db using LINQ but I think that something is missing.
    in every example that I saw its the same.
    well I look at the LINQ query and it all understood except how I tell the compiler in which db to search for.
    for instance...

    Dim q = From e In db.Employees _
    Select New Name With {.FirstName = e.FirstName, .LastName = e.LastName}o

    how the compiler should know what is db.Employee???
    Thank you all..

  2. #2
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Linq to sql

    You'd set up the connection string, and have the IDE open it before the LINQ statement executes. You can change the connection string to open MySQL, but they aren't exactly the same, and you'd have to modify things accordingly.

    I'd suggest MSSQL or SQL Express.
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

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

Featured