View Single Post
 
Old April 3rd, 2009, 07:38 PM
allan_ravn allan_ravn is offline
Registered User
 
Join Date: Feb 2009
Posts: 5
Thanks: 3
Thanked 0 Times in 0 Posts
Default How To: Use hosted mySQL DB instead of local SQL express DB?

I have a webapplication made from scratch with using "Beginning ASP.NET 3.5: xxx" and after finishing my implementation I'd like to "test it" with a mySQL database that is another server.

I had the (simplistic?) idea that it would be enough to substitute my (working) local connection SQL express string:

Working :-)
<addname="local"connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirector y|\Database.mdf;Integrated Security=True;User Instance=True"
providerName="System.Data.SqlClient" />

With the one from the remote server:

Not working
<add name="local" connectionString="{MySQL ODBC 3.51 Driver};Server=ServerIP; Port=3306;Database=Allan_testDB;User=Allan_DB;Pass word=myPSW;Option=3;"
providerName="System.Data.SqlClient" />

And then be able to use the webapplication as if "nothing happened" (but of course now using the remote database which doesn't have any content).

First question
Can I assume that just exchanging the local connection string with the remote connection string will make my webapplication "see and use" the remote mySQL database without making any further modifications?

Second question
The above mySQL connection string doesn't work - the page throws the following exception:
Exception Details: System.ArgumentException: Keyword not supported: '{mysql odbc 3.51 driver};server'.

Any good opinions ans advice will be appreciated . Br. Allan