MySQL database connectivity

S

Steven Caliendo

Hi,

I have a MySQL database on a remote server that I need to connect to. I
can't seem to figure out what the connectionstring should be? I've searched
through the help files, but all I can find is information for SQL server.

Thanks,

Steve
 
M

Mark Fox

You have to get a MySQL data adapter component. do a
google search for "mysql ado.net"
 
J

Joe Gass

That's right you need to install myOdbc on the webserver (from
www.mysql.com)
Then use a connection string like

driver={MySQL ODBC 3.51
Driver};server=127.0.0.1;uid=yourUsername;pwd=yourPassword;database=yourData
base;OPTION=16834;
or
driver={MySQL};server=127.0.0.1;uid=yourUsername;pwd=yourPassword;database=y
ourDatabase;OPTION=16834;

depending on the myodbc version

I have used Microsoft.Data.Odbc to access the db in .net version 1.0 (you
have to download this too)
or System.Data.Odbc if you are using version .net 1.1 (included in 1.1
framework)

HTH
 
D

dryer

I've had great luck with ByteFX's MySQL data provider library, check it out at:
http://www.bytefx.com/dotdata.aspx


After that, connection is as easy as:
string connstrg = "Server=localhost;Database=mydatabase;User
ID=myuserid;Password=mypassword";
m_dbconn = new MySqlConnection(connstrg);
m_dbconn.Open();

dryer
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top