how to get connection string on aspx page from web.config file using mysql odbc driver?

settings in web.config
    <add name="Connection" connectionString="Driver={MySQL ODBC 3.51 Driver};datasource=mySQL;database=;uid=;password=" providerName ="System.Data.Odbc"/>

Code in aspx.cs page to connect to web.config connection string
 string ConnStr = System.Configuration.ConfigurationManager.ConnectionStrings["Connection"].ToString() ;

I am getting this error message
ERROR [HY000] [MySQL][ODBC 3.51 Driver]Can't connect to MySQL server on 'localhost' (10061)
ERROR [HY000] [MySQL][ODBC 3.51 Driver]Can't connect to MySQL

help is greatly appreciated!
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Here is a great site:

Pick the server you're using...most likely Sql Server 2005 and see how all the connect strings are built...
are you using a mySql DB?
bschave2Author Commented:
yes, mysql driver to get to mysql db. the link above is for connection strings only. I have the connection string, but noo way to connect to the string on my asp page.
10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

found someone with a same problem:

"I discovered that the cause of the problem was my using ODBC driver instead of MySQL Connector; apparently my ISP does not support ODBC.  Also I was using

I rewrote the connection string in my web.config file and now my application works."

bschave2Author Commented:
right, but I need the code to reference the connection string on my pages.
pls explain because that's what this does:

 string ConnStr = System.Configuration.ConfigurationManager.ConnectionStrings["Connection"].ToString() ;

Maybe you post more code...what do yo mean by 'I need the code to reference the connection string on my pages'

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
bschave2Author Commented:
the string was incorrect. it didn't support the string from the web.config file. correct code is

  OdbcConnection con = new OdbcConnection(System.Configuration.ConfigurationManager.ConnectionStrings["Connection"].ToString());
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.