3

I am using System.data.odbc with "Driver={MySQL ODBC 5.1 Driver}" in the connection string. However, I have not realised there is MySQL connector installed on my PC so however I have not referenced it, it doesn work without it. Now I need to distribute it embed in the app. I have downloaded MySQL Connector/ODBC 5.1 files, but with Add reference it says "The file is not accessible...make sure its valid COM.." etc. Thank you

3 Answers 3

7

MySQL Connector/ODBC is, as the name suggests, just an ODBC driver for connecting to MySQL. It's not specifically designed for .NET and you can't embed it in your .NET applications in any way. It will need separate installation on any machine where you need to use it.

MySQL Connector/Net is a fully managed ADO.NET provider for MySQL. It's tailor-made for .NET and doesn't require the installation of any other software. It's easy to reference and distribute in your .NET applications, you'll just need to use the System.Data.MySqlClient namespace and objects rather than System.Data.Odbc.

1

You can embed the .NET DLL, but not the driver itself. You'll need to install MySQL Connector on every computer that runs your application.

8
  • Are you sure? What about MySQL connector .NET, when referenced, you can use its namespace
    – Petr
    Nov 12, 2009 at 14:47
  • AFAIK the referenced DLL still requires a driver. But I'm never 100% sure, if you find a way, I'd be very interested :)
    – Andomar
    Nov 12, 2009 at 14:51
  • I find it pretty limitating if users are forced to install another piece of software. What is the difference between MySQL ODBC Driver and .NET Connector?
    – Petr
    Nov 12, 2009 at 15:04
  • 4
    Guys, can we keep the misinformation to a minimum? 1. The .NET MySql Connector is standalone - no mysterious "driver" is needed beyond it. 2. You don't have to "install" it - just reference it: drop it in your resource section and Assembly.Load it when the app starts. Nov 12, 2009 at 16:05
  • 2
    @Andomar: It's true for Connector/Net, but not for Connector/ODBC, as I explained in my answer. MySql.Data.dll is part of Connector/Net but the question suggests that the OP is using Connector/ODBC in their application.
    – LukeH
    Nov 13, 2009 at 9:42
0

The only thing u need is Mysql.Data.Dll You don't need to install the complete connector, everything u need is in there. That also counts for the end user, they also only need the dll

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.