5

How to use LINQ to SQL with mySQL.

I am having one project with C# (version 2010) and Linq to SQl. Database is SQl

Need Solution for,

I need to migrate the project to Linq to mysql and C# version 2010

And also need to migrate existing sql database to mysql database

(I Downloaded DBLinq but dont know how to use it in project)

Neil Thompson
  • 6,316
  • 2
  • 28
  • 52
kala
  • 111
  • 2
  • 3
  • 7

3 Answers3

8

LINQ to SQL is designed to work with Microsoft SQL Server only, as far as I know. If possible, you should migrate to Entity Framework or another DB-agnostic O/R-mapper.

Matthias Meid
  • 12,260
  • 7
  • 43
  • 76
2

Check out 'LINQ to MySql' nuget.

https://www.nuget.org/packages/linq2db.MySql/

LINQ to MySql is a data access technology that provides a run-time infrastructure for managing relational data as objects.

This package includes a T4 template to generate data models for MySql database and references to the linq2db and MySql.Data nugets.

Action Dan
  • 431
  • 4
  • 9
1

I'm pretty sure there is a provider for it (same as for SqlLite).

Take a look at the following links:

DBLinq should have everything you need though...

Littm
  • 4,903
  • 4
  • 29
  • 37
Tim Sommer
  • 419
  • 2
  • 15