Connect to MySQL Database

I am reading up on this and cannot seem to get it right.

I am sure there is an oleDB way of connecting to a MySQL Database which is localhost.

can anyway give me any ideas of how to do this.

thanks in advance

Andy
LVL 20
REA_ANDREWAsked:
Who is Participating?

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

x
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.

Arthur_WoodCommented:
here is the conncetion string for MySQL:

"Provider=MySQLProv;Data Source=mydb;User Id=UserName;Password=asdasd;"

you can alose checkout out the MySQL Connection strings as

http://www.connectionstrings.com/

AW
REA_ANDREWAuthor Commented:
Where in that string Can I supply the server as locahost?

Also Can you show me this integrated with the connectionStrings Tab in the config file. as i am a bit rusty of how to write them

thanks very much

Andy
existenz2Commented:
Have a look at this example: http://www.csharphelp.com/archives2/archive288.html

That includes a example project on how to do it with Oledb.
Become a Microsoft Certified Solutions Expert

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

REA_ANDREWAuthor Commented:
I now get this error

Compiler Error Message: CS0246: The type or namespace name 'MySql' could not be found (are you missing a using directive or an assembly reference?)

Source Error:

 

Line 15:     protected void Page_Load(object sender, EventArgs e)
Line 16:     {
Line 17:         MySql.Data.MySqlClient.MySqlConnection conn;
Line 18:         string myConnectionString;
Line 19:
 
existenz2Commented:
You need to add the library MySql to your project. Right Click on your project name. Click Add Reference and add the approriate dll.

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
REA_ANDREWAuthor Commented:
I have done that. in visual Studio. then I ssave it close it down and copy all the files to the server. It then again gives me the error message. Why will it not find it on the server when the bin directory is write there
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
ASP.NET

From novice to tech pro — start learning today.