How to connect MySQL database using .NET?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to access MySQL database using ADO.NET? I have installed the connector
from MySQL's website, but don't know how to proceed further? Kindly help
 
Just use it like any other IDBProvider object ie

ConnectionType cn = new ConnectionType(connectionString);

CommandType cmd = new Commandtype("SQL Statement", cn);
 
Saket,

I see that you did already ask your quesion in this newsgroup as I advised
today in the newsgroup languages.vb.

However because I saw your question in the language.vb newsgroup do I think
that the answer from Bill not brings you much further at this moment.

You got your answers how to connect while probably you are asking how to
use. However the posibilities with dotNet are endless with that, so maybe
you can explain your question something more (is it for a web application, a
windowsform application, what do you want to do)

Cor
 
Cor,

I am developing a Website using ASP.NET with backend on MySQL? As u asked I
am specifying exactly what i need to know

1) Can we connect to MySQL using classes in System.Data.OdbcClient or
System.Data.OledbClient namespace ? Is ODBC or oledb driver available for
MySQL?
2) If we have to use the Connector provided by MySQL, what is the reference
i need to add in the project so that i can access and import
MySQL.Data.MySQLClient namespace?

I hope this clarifies my point.
Thank you for ur help.

Saket Mundra
 
Saket said:
Cor,

I am developing a Website using ASP.NET with backend on MySQL? As u asked I
am specifying exactly what i need to know

1) Can we connect to MySQL using classes in System.Data.OdbcClient or
System.Data.OledbClient namespace ? Is ODBC or oledb driver available for
MySQL?
2) If we have to use the Connector provided by MySQL, what is the reference
i need to add in the project so that i can access and import
MySQL.Data.MySQLClient namespace?

ODBC is phased out at microsoft, don't go that route (as it is also
very slow compared to native providers). There are a couple of .NET
providers for MySql. The free ones are all GPL-ed, so if your
application is a commercial application, be aware of this that you then
also have to GPL your software if you use them. MySQL provides one of
them, it's the old ByteFX provider. Another is available at sourceforge,
search for MySQL and .NET, I don't have the url here.

You can also use the commercial provider from Corelab (www.crlab.com).
We use that one and it's very good.

Frans.
 
Back
Top