Link to home
Start Free TrialLog in
Avatar of clear100-com
clear100-com

asked on

Syntax issues...

Why is this not working???  Im trying to convert this: https://www.experts-exchange.com/questions/21253647/ADO-NET-using-mySQL-as-a-connection.html (VB.NET) to this...
using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        private System.Data.Odbc.OdbcConnection mconnCurrent;
        private const string mstrServerName = "localhost";
        private const string mstrUsername = "root";
        private const string mstrPassword = "wd006451";

        static void Main(string[] args)
        {
            string sqlSelect;
            System.Data.Odbc.OdbcDataAdapter com;
            System.Data.Odbc.OdbcCommand queryCom;
            System.Data.DataSet ds;
            string strConn;
            string strDBName;

            strDBName = "test";
            strConn = "DRIVER={MySQL ODBC 3.51 Driver}" +
                         ";SERVER=" + mstrServerName +
                         ";DATABASE=" + strDBName +
                         ";UID=" + mstrUsername +
                         ";PWD=" + mstrPassword +
                         ";OPTION=3";
            this.mconnCurrent = new System.Data.Odbc.OdbcConnection(strConn);
            this.mconnCurrent.Open();

        }
    }
}
Avatar of vbguest
vbguest

Could you be more specific on what your problem is? What do you mean by "not working"?
ASKER CERTIFIED SOLUTION
Avatar of Yurich
Yurich
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
that's a link to download the odbc driver:

http://dev.mysql.com/downloads/connector/odbc/3.51.html