user91089
user91089

Reputation: 303

Is there a default SQL Driver included with the .NET Framework?

What I'm looking for is a driver that is included with the .NET runtime to reference in my connection string (DRIVER={ ... }).

I'm currently referencing "MySQL ODBC 3.51 Driver" but this must be installed on the target machine. I'm not against redistributing the driver but if there is one I can use that is built into .NET, I would much rather go that route.

Thanks!

Upvotes: 0

Views: 1375

Answers (2)

bbqchickenrobot
bbqchickenrobot

Reputation: 3709

I believe the MSSQL ADO.NET Providers (drivers) are installed when the .NET runtime is instsalled, but it looks like you're rockin MySql. You're best bet is to use the .NET ADO.NET Provider for MySql (not the ODBC driver), it's called MySql Connecter/.NET. Technically, the ado.net provider still has to reside on the machine that's making the call to the database (i.e. - web server or client workstation) but you don't have to "install" it... you can package it with your app via xcopy or ClickOnce, etc... I believe the ODBC driver you speak of must be installed via installation exe or msi. Also, ODBC is old and slow and you should not use it unless there is a specific requirement to do so. Use this:

http://dev.mysql.com/downloads/connector/net/6.0.html

You will be able to use ado.net just as if it were using MS SQL Server.

This will also work with the entity framework i believe.

Upvotes: 0

Jon Skeet
Jon Skeet

Reputation: 1503479

There are drivers for SQL Server and Oracle included in the framework, but not one for MySQL.

However, there is a standalone .NET driver which I suspect doesn't require installation. Note that it's GPL - if your app is not a GPL app, you should check the licence very carefully, or look for another similar driver.

Upvotes: 1

Related Questions