Web.Config :
<add name="locator" connectionString="Driver={MySQL ODBC 5.3 ANSI Driver};SERVER=localhost;DNS=myDNS;Database=myDatabase;UID=root;OPTION=3" providerName="System.Data.Odbc" />
Behind code :
using System.Data.Odbc;
string ConnectionString = ConfigurationManager.ConnectionStrings["locator"].ToString();
DbConnection = new OdbcConnection(ConnectionString);
DbConnection.Open()
I have been go through check with the list below:-
Win+RUN => odbcad32.exe
Data Sources (ODBC) - Installed Windows (x86, 64-bit), MSI Installer
REF:
http://dev.mysql.com/downloads/connector/odbc/
Connection Parameters:
Data Souces Name: myDNS
Description : [leave it empty]
TCP/IP address : 127.0.0.1
Name Pipe : [AutoDisabled]
User : root
password : [blank]
Database : myDatabase
Click button test -> Connection Successful
Click OK
I do the same with [User DNS] and [System DNS].
Click Tab -> Connection Pool
Enable perfMon
Click Apply
Connection string value - >
Driver={MySQL ODBC 5.3 ANSI Driver};SERVER=localhost;DNS=myDNS;Database=myDatabase;UID=root;OPTION=3
The value is there, but when it come to open the database, it hit the error of the subject title. LOCALHOST was running well, as i using HeidiSQL 8.3.0.4694 it allow me to connected the local database using UID: root and pwd: [blank].
Information Hosting & debugging
hosting : wampServer 2.1 x32[Online]
Database : mySQL [Heidi 8.3]
Visual studio: debugging mode hit the error.
OS : windows 7
Anything i can furthermore to check with? Please help out =(