title: connecting to local database in wpf application : error 26
body: <p>WPF with local database application<br>
  I was about to start but I faced this problem  </p>
  
  <p><em>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)</em>  </p>
  
  <p>I searched alot to found that the error will be in the connection string<br>
  but I'm using the connection string from application settings which done by the wizard  </p>
  
  <pre><code>using ( SqlConnection _SqlConnection = new SqlConnection ( Properties . Settings . Default . DatabaseConnectionString ) )
  {
      _SqlConnection . Open ( );   // &lt;= Error Occurs Here
      _SqlConnection . Close ( );
  }
  </code></pre>
  
  <p>Error :  </p>
  
  <p><em>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)</em></p>