title: What's the difference between Data Source and Server in connection string? And why the 1st doesn't work and 2nd does?
body: <p>My colleague and I hit one tricky problem in C#, that when accessing the local SQL Server 2012, the code works fine using "server" in the connection string, while the connection will fail and timeout when we use "Data Source". Below is the sample code:</p>
  
  <p>server:</p>
  
  <pre><code>SqlConnection sc = 
     new SqlConnection( @"user id=sa;password=blabla;server=(local)\sql2012;database=Dummy.Database;connection timeout=30" );
  </code></pre>
  
  <p>data source version:</p>
  
  <pre><code>SqlConnection sc = 
      new SqlConnection( @"Data Source=(local)\sql2012;Initial Catalog=Dummy.Database;User=sa;Password=blabla;MultiSubnetFailover=true" );
  </code></pre>
  
  <p>Then the 1st will pass when calling</p>
  
  <pre><code>sc.Open( );
  </code></pre>
  
  <p>while the 2nd cannot. What could be the root cause of the difference?</p>
  
  <p>I'm using Win7 x64 with VS2013 Premium. Great thanks.</p>
  
  <p>By the way, using the exact same settings, and the data source version still fails.</p>
  
  <p>SqlConnection sc = new SqlConnection( @"User=sa;Password=blabla;Data Source=(local)\sql2012;Initial Catalog=Dummy.Database;connection timeout=30" );</p>
  
  <p>Just checked the Configuration manager, and named pipe/TCP IP/shared memory are all enabled. Firewall is on, but since I'm using localhost, the packets are looped back without touching the physical network, so should be fine?</p>
  
  <p>Besides, I'm using</p>
  
  <p>Microsoft SQL Server 2012 - 11.0.2100.60 (X64) 
  Feb 10 2012 19:39:15 
  Developer Edition (64-bit) on Windows NT 6.1  (Build 7601: Service Pack 1)</p>