Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to use LINQ to SQL with mySQL

Tags:

c#

mysql

linq

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)

like image 910
kala Avatar asked Sep 12 '12 12:09

kala


People also ask

Can you use LINQ with MySQL?

LinqConnect (formerly known as LINQ to MySQL) is a fast and lightweight ORM solution, which is closely compatible to Microsoft LINQ to SQL and contains its own advanced features, such as complex type support, advanced data fetching options, configurable compiled query caching, and others.

Is LINQ converted to SQL?

LINQ to SQL translates the queries you write into equivalent SQL queries and sends them to the server for processing. More specifically, your application uses the LINQ to SQL API to request query execution. The LINQ to SQL provider then transforms the query into SQL text and delegates execution to the ADO provider.

Is LINQ to SQL still used?

LINQ to SQL was the first object-relational mapping technology released by Microsoft. It works well in basic scenarios and continues to be supported in Visual Studio, but it's no longer under active development.


2 Answers

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.

like image 190
Matthias Meid Avatar answered Sep 27 '22 01:09

Matthias Meid


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.

like image 26
Action Dan Avatar answered Sep 24 '22 01:09

Action Dan