locked
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:
    E_FAIL(0x80004005)
    below the code:
                InitializeComponent(); 
                System.Data.OleDb.OleDbConnection con; 
                con = new System.Data.OleDb.OleDbConnection(""); 
                con.ConnectionString = "Provider=MySQLProv;Data Source=mysql;"
                try 
                { 
                    con.Open(); 
                    if (con.State == ConnectionState.Open) MessageBox.Show("Connection to MySQL opened through OLE DB Provider"); 
                    con.Close(); 
                } 
                catch (Exception ex) 
                { 
                    MessageBox.Show(ex.Message); 
                } 

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



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

Answers

All replies