title: .NET Core 2 - Connection string with instance name and port number
body: <p>In my application I have a connection string in the config. This application created using .NET core 2.11 and SQL Server. This is the connection string:</p>
  
  <pre><code>Data Source=servername\instancename, portnumber;Initial Catalog=dbname;Persist Security Info=True;User ID=username;Password=password;
  </code></pre>
  
  <p>This string causes an error as shown here:</p>
  
  <p><a href="https://i.stack.imgur.com/C3gRO.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/C3gRO.jpg" alt="enter image description here"></a></p>
  
  <p>This error happens if I use instance name and port number in the string. If I remove either one, it is working. So, how do I make it work to used both instance name and port number in the connection string?</p>