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.

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 don't know how to use it in project.

2

3 Answers 3

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.

Sign up to request clarification or add additional context in comments.

Comments

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.

Comments

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...

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.