title: Can not connect to local database with c# System.Data.SqlClient
body: <p>I have some problems with connecting to my local DB using c# System.Data.SqlClient.</p>
  
  <p>Information:</p>
  
  <ul>
  <li>DB parameters: Name:<code>baza</code> Host:<code>localhost</code> Instance:<code>baza</code> Port:<code>3306</code> Schema:<code>world</code></li>
  <li>My connection string: <code>@"server=localhost\baza;password=pass;User Id=root;database=world;Persist Security Info=True"</code></li>
  <li>using: c#, System.Data.SqlClient, MySQL Workbench</li>
  <li>firewall off</li>
  <li>succesfull conection with JDBC, so server is working</li>
  </ul>
  
  <p>JDBC parameters:  </p>
  
  <pre><code>String url = "jdbc:mysql://localhost:3306/";
  String driver = "com.mysql.jdbc.Driver";
  String dbName = "world";
  String username = "root";
  String pass = "pass";
  </code></pre>
  
  <p>Problem:</p>
  
  <ul>
  <li>when I use conn.Open(); this happen => (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)</li>
  </ul>
  
  <p>Tried:</p>
  
  <ul>
  <li>server=localhost then it gives => error: 40 - Could not open a connection to SQL Server</li>
  <li>many other stupid combinations like server=baza</li>
  <li><a href="http://blogs.msdn.com/b/sql_protocols/archive/2007/05/13/sql-network-interfaces-error-26-error-locating-server-instance-specified.aspx" rel="nofollow noreferrer">http://blogs.msdn.com/b/sql_protocols/archive/2007/05/13/sql-network-interfaces-error-26-error-locating-server-instance-specified.aspx</a></li>
  <li><a href="https://stackoverflow.com/questions/3665084/asp-net-beginner-question-how-to-get-rid-of-this-error">ASP.NET beginner question: How to get rid of this error?</a></li>
  <li>Connection to freesql.org server also failed</li>
  </ul>
  
  <p>I have no idea what to do... Sth is probably with server name.</p>
  
  <p>EDIT: 
  code:</p>
  
  <pre><code>string connstr = @"Data Source=localhost\baza;password=qspass;User Id=root;"+
      "Initial Catalog=world;Persist Security Info=True";
  
  Console.WriteLine(connstr);
  
  SqlConnection conn = new SqlConnection(conbuild.ConnectionString);
  conn.Open();
  
  Console.WriteLine("YO!");
  Some more code...
  </code></pre>
  
  <p>Never reached YO! :P</p>