[.net] .Net + MySQL, anyone?

Started by
13 comments, last by markr 17 years, 5 months ago
anyone know how to get MySQl working under a .Net app? Since .Net doesn't have native support for MySQL I was thinking i could use ODBC. my MySQL database is remotely accessible on freesql.org when i attempt to open a connection i get an exception. something about odbc driver. am i trying the impossible here?
Advertisement
This link looks good: http://dev.mysql.com/tech-resources/articles/dotnet/

(I just typed ".net MySql" into Google and that was the first result)
You might want to look in to ADO.NET if you are using .NET for this. I found a few tutorials that would connect to my local server and get some data, but decided to just buy a book on the subject.
im about to try out that link that was posted. incidentally though, i did try that search query. i've tried many different combinations. no real luck though.

as for the ado.net, that is exactly what im using.
ado.net supports SQL, OLE, ODBC, and Oracle. MySQL is different from these, but like i said, i tried ODBC, a generic approach to generic database connections.
"There are a number of fully managed .NET providers available to help MySQL users develop applications in the .NET environment.

Two popular choices are:

1. ByteFX.Data
2. CoreLabs"

i just downloaded CoreLabs. this is better than what i'd expected! thanks very much.
I don't mean to hijack this, but does anyone know how well these things work with ASP.NET?
Download the "MySQL Connector Net 1.0.7" from the MySQL website. It is what I use, and I'm finding it to be quite beginner friendly.
Quote:Original post by Thevenin
Download the "MySQL Connector Net 1.0.7" from the MySQL website. It is what I use, and I'm finding it to be quite beginner friendly.


thats the way to go imho. basically its a simple library dll, you have to distribute with your app. you get the mySQL namespace with all the familiar ADO objects implemented having mySQL prefixes instead of sql/odbc/lodb/other...
"Knowledge is no more expensive than ignorance, and at least as satisfying." -Barrin
Absolutely. You should be able to use almost any database with .NET. If the database has at least an ODBC interface, you can use .NET to connect to it. ODBC is not the best choice though, as it's very generic, and has no optimizations for specific databases. It is best to use a .NET connecter for the database if it is available. There is one provided by MySQL.

Incidentally, I wrote about this a while ago. I'd suggest taking a look on my website, under ASP.NET (applies to .NET in general), for more info.
Grant Palin
I accessed a MySQL DB from C# about 3 yrs ago. It wasn't hard but my memory is fuzzy...

I don't think MySQL had a .NET interface then. Apparently from the above posts, now it does.

When you tried ODBC and failed, I'm guessing you neglected to install MySQL's client-side ODBC driver. I believe, for any DB which supports ODBC, you have to install that DB's client-side ODBC driver for it to work.

This topic is closed to new replies.

Advertisement