Hi, 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
+1
A:
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.
Andomar
2009-11-12 14:42:10
Are you sure? What about MySQL connector .NET, when referenced, you can use its namespace
Petr
2009-11-12 14:47:04
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
2009-11-12 14:51:38
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
2009-11-12 15:04:31
I think the .NET Connector makes the ODBC driver easy to use from .NET programs
Andomar
2009-11-12 15:06:28
Maybe...it confuses me that with .NET you can reference that mysqldata.dll and use its namespaces.
Petr
2009-11-12 15:08:53
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.
Frank Krueger
2009-11-12 16:05:49
@Frank Krueger: If that's true, you could copy the MySql.Data.dll with your program and it would run on any machine? I'll test that, if it's true it'll save us a lot of work, as we've been deploying the Connector installation to a lot of machines.
Andomar
2009-11-12 16:34:31
@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
2009-11-13 09:42:35
+2
A:
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 taylor-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
.
LukeH
2009-11-12 15:52:53