Click here to Skip to main content
16,012,468 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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...
VB
Dim q = From e In db.Employees _
           Select New Name With {.FirstName = e.FirstName, .LastName = e.LastName}


How the compiler should know what is db.Employee???
Thank you all..
Posted
Updated 4-Oct-10 13:00pm
v2

You may need a MySQL specific LINQ provider. This is a copy of ananswer I posted in a similar thread a few weeks ago.

Here's a free implementation:

http://code2code.net/DB_Linq/[^]

And here's a commercial one:

http://www.mindscapehq.com/products/lightspeed/[^]
 
Share this answer
 
Comments
Espen Harlinn 24-Feb-11 3:43am    
Good links :)
You have to generate model before LINQ-query usage. When model was generated, LINQ already knows what is it - db.Employee (db is a context name). Also, standard L2S doesn't support MySQL db server. Try to use 3-rd party - this one http://www.devart.com/linqconnect/[^], for example.
 
Share this answer
 
If you are not familiar with accessing MySql from VB.Net then I suggest that you follow this series of tutorials[^].

By the time that you get to the end, the answer to your question should be obvious.
 
Share this answer
 
Comments
Espen Harlinn 24-Feb-11 3:47am    
Good advice :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900