title: .net SqlClient and .NET CORE Web API connection string
body: <p>Is it me or tis there a different way that sqlclient and .net core uses the connection string.</p>
  
  <p><strong>example old client:</strong></p>
  
  <pre><code>var connectionString = "Data Source=SQLSERV1\\SQLSERV1;Initial Catalog=mydb;User ID=myuser; Password=mypass;";
  using (SqlConnection conn = new SqlConnection(connectionString))
  {
      ....etc
  </code></pre>
  
  <p>Code works fine, results come back from this sql client query.</p>
  
  <p><strong>Now in .NET CORE web API :</strong></p>
  
  <p><strong>appsettings.json</strong></p>
  
  <pre><code>"Data": {
      "DefaultConnection": {
          "ConnectionString": "Data Source=SQLSERV1\\SQLSERV1;Initial Catalog=mydb;User ID=myuser; Password=mypass;"
      }
  }
  </code></pre>
  
  <p><strong>Startup.cs</strong></p>
  
  <pre><code>public void ConfigureServices(IServiceCollection services)
  {
      services.AddApplicationInsightsTelemetry(Configuration);
  
      services.AddMvc()
          .AddJsonOptions(config =&gt;
          {
              config.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();
          });
      services.AddDbContext&lt;MW_MereSysContext&gt;(options =&gt; options.UseSqlServer(Configuration["Data:DefaultConnection:ConnectionString"]));
  </code></pre>
  
  <p>when i try to nav to the url in my browser i get:</p>
  
  <blockquote>
    <p>An unhandled exception occurred while processing the request.SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)</p>
  </blockquote>
  
  <p>So how is it that sqlclient sees the server fine, but .net core cannot? is it the way it process the string i.e the fact its on a domain?</p>