Including MySQL Connector/ODBC 5.1 to C# application - c#

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

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.

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.

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

Related

Oracle ODBC data client - C#

I installed Oracle 11g home edition. I read that to use Oracle data access via .NET, I must install "Oracle ODAC" from http://www.oracle.com/technetwork/database/windows/downloads/index-090165.html
The readme text file mentions that "The files of this zip file is NOT to be installed on top of an existing Oracle Universal Installer (OUI) based Oracle Home installation"
I don't understand. How am I supposed to get Oracle.data.access.dll for the existing Oracle install then?
I used setup.exe file to update the database and checked the option to install .net option. It worked then.

Could not load file or assembly 'MySql.Data, Version=6.5.4.0

I know this looks like the same issue in 2041051 but I have a different question.
I have a C# app that uses MySQL 5.5. It's built using MySQL Connector .Net 6.5.4.0 (which came with MySQL 5.5). Everything works fine running on my computer. When the app is run on a computer that has MySQL 5.6 installed, the app fails with the error shown in the title above. I think MySQL 5.6 installs Connector 6.6.5. So it seems I have a couple options:
1) Add an explicit reference to the 6.5.4.0 connector, make it Copy Local, and distribute it along with my app.
2) Make my app somehow insensitive to the specific version of the connector. I have no idea how to do that, or if it's even possible.
3) ?
Do I understand the problem correctly? What's the best solution?

IBM db2 driver deployment / installation

I'm trying to connect to IBM DB2 database with C# application. At first I've installed IBM Data Server Driver Package, which, according to the documentation is for applications using ODBC, CLI, .NET, OLE DB, PHP, Ruby, JDBC, or SQLJ, use IBM Data Server Driver Package. Then I thought I could use IBM.Data.DB2 assembly and happily connect. It didn't work at all, as the app kept crashing while looking for db2app.dll in its current working directory.
Then I installed IBM Data Server Client, which has this dll in "bin" directory, which I added to system path. That didn't help, so I copied it to my app's build directory, and it now works. But I don't think that is correct, as I also had to copy msg\en_US\db2nmp.xml file to my build directory to get exception error texts.
I think it's wrong to copy all these files from DB2 installation, and I should somehow be able to force IBM.Data.DB2 assembly to look for its required files in the system path, not in its working directory. I also think that Data Server Driver Package should be enough, but I wasn't able to do anything with IBM.Data.DB2.dll until I installed the larger Data Server Client.
I assume that the problem is on my end, not with IBM, so I'm doing something obviously or subtly wrong.
My question is: How do I use the smaller IBM Data Server Driver Package with .NET application?
I think you are looking for this information that is available in DB2 manual:
http://pic.dhe.ibm.com/infocenter/db2luw/v9r7/topic/com.ibm.swg.im.dbclient.adonet.doc/doc/c0010960.html
And perhaps this helps also:
http://www.ibm.com/developerworks/wikis/display/DB2/DB2%20and%20.NET%20FAQs#DB2and.NETFAQs-WherecanIfindtheDB2.NETproviderandVSAddins%3F
In general, I think you should've installed IBM Database Add-Ins for Visual Studio from here(Requires IBM Registration):
https://www14.software.ibm.com/webapp/iwm/web/preLogin.do?source=swg-daivs

How to make software developed in WinForms .NET 3.5 with SQL Express portable

i found that its really pain to create setup and deployment packages for windows xp/vista/7
so my question is can i make my application portable with any third party tool such as thin app ?
my application requires dot net 3.5 framework and sql express 05 installed i want to put it on usb drive and user can execute it directly from usb drive without any setup and deployment, if there any other ways to achieve portability for software please let me know?
thanks !
In order to check if .Net 3.5 and sql express is installed you can check if they are registred in the registry.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\MSSQLServer\CurrentVersion - CurrentVersion
But you cannot check this with your 3.5 compiled assembly, so you need a non-dotnet application to do it, like a setup program.
Either you have to create a launcher in something like c++, or you could create a vb script launcher which checks the prerequisites before launching your .net app.
Neither SQL Express nor the .NET Framework will not run without being installed on the local hard disk.
Source for SQL Express: http://social.msdn.microsoft.com/Forums/en-US/sqlsetupandupgrade/thread/fc729d31-8a0b-4156-ab75-4fec652a438b.
#Mikael already told the trick for .NET detection which you should take a look at.
I just want to add that for portable applications, you should use SQL Server Compact edition instead of Express,
Link

MySQL client portability for my C# app

I am building an application which needs to connect to a central MySQL database. The application is written in C#. I have installed the .NET connector from MySQL for the VS integration.
I was wondering if there is anything special I need to do to be able to have my application be portable and not require an install of the connector on every machine it is used on?
There is a similar question I found here on SO, but it is for a server instead instead of client which is very different.
Edit:
Connector I used: .NET connector 6.2.3 (
http://www.mysql.com/downloads/connector/net/)
When you make an installer, you can include the dll for the mysql connecter such that it is copied along with the other side. This way, whenever the application is installed properly, you wont have the problem.

Categories

Resources