connection to MySql database...Provider? Data Source? RRS feed

  • Question

  • Hi, i'm not able to connect to mySql database, I dowloaded the driver and installed it, the packet name is "myoledb-3.9.6.msi", created a DNS user with "MySQL ODBC 5.1 Driver" driver but i get an error like this:
    below the code:
                System.Data.OleDb.OleDbConnection con; 
                con = new System.Data.OleDb.OleDbConnection(""); 
                con.ConnectionString = "Provider=MySQLProv;Data Source=mysql;"
                    if (con.State == ConnectionState.Open) MessageBox.Show("Connection to MySQL opened through OLE DB Provider"); 
                catch (Exception ex) 

    I think the problemi is in this string "Provider=MySQLProv;Data Source=mysql;" What should i use as Provider and Data Source?

    • Moved by Peter Ritchie Thursday, June 19, 2008 7:52 PM off-topic
    Thursday, June 19, 2008 8:19 AM


All replies