I tried several ways no without any success (OdbcConnection, MySqlConnection, ...). With PHP it was working within a minute. But I want to access the database using a Web Service (asmx).
The Web Service is returning correct information back:
MYSQLCONNSTR_localdb = Environment.GetEnvironmentVariable("MYSQLCONNSTR_localdb").ToString();
dbhost = Regex.Match(MYSQLCONNSTR_localdb, @"Data Source=(.+?);").Groups[1].Value;
dbname = Regex.Match(MYSQLCONNSTR_localdb, @"Database=(.+?);").Groups[1].Value;
dbusername = Regex.Match(MYSQLCONNSTR_localdb, @"User Id=(.+?);").Groups[1].Value;
dbpassword = Regex.Match(MYSQLCONNSTR_localdb, @"Password=(.+?)$").Groups[1].Value;
Database=localdb;Data Source=127.0.0.1:xxxxx;User Id=azure;Password=blabla
But how to access the database localdb?
With: new OdbcConnection("DRIVER={MySQL ODBC 5.3 unicode Driver}; ...
Using this method I receive error: System.Data.Odbc.OdbcException: ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
I expect it works different to a MySQL database in Azure. But how for MySQL In App?
Thanks for help in advance!
string connectionString = string.Format("Server=127.0.0.1; Port=50981; Database=localdb; Uid=azure; Pwd=password"); MySqlConnection conn = new MySqlConnection(connectionString);