title: How to connect to the Azure MySQL In App localdb using c#
body: <p>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).</p>
  
  <p>The Web Service is returning correct information back:</p>
  
  <pre><code>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;
  </code></pre>
  
  <blockquote>
    <blockquote>
      <p>Database=localdb;Data Source=127.0.0.1:xxxxx;User Id=azure;Password=blabla</p>
    </blockquote>
  </blockquote>
  
  <p>But how to access the database localdb?</p>
  
  <p>With: <code>new OdbcConnection("DRIVER={MySQL ODBC 5.3 unicode Driver};</code> ...</p>
  
  <p>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</p>
  
  <p>I expect it works different to a MySQL database in Azure. But how for MySQL In App?</p>
  
  <p>Thanks for help in advance!</p>