2

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:

Data Source=servername\instancename, portnumber;Initial Catalog=dbname;Persist Security Info=True;User ID=username;Password=password;

This string causes an error as shown here:

enter image description here

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?

1
  • 1
    Have a look here for how to specify the port number: stackoverflow.com/a/5294741, I would avoid the space between the comma and the actual number. I'm not sure you can use a port number with an instance. Commented Mar 22, 2019 at 4:09

1 Answer 1

1

Found the answer. Instance name will be use dynamic port, so I cannot use default port number (1433). Need to change the port number to used 1433 instead of the dynamic port.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.