A
A
alex995052017-11-11 19:42:40
C++ / C#
alex99505, 2017-11-11 19:42:40

How to correctly specify the connection port to MS SQL Exrpess 2012?

The database server is online on the SERVER computer. I'm trying to connect like this

private string server_adress = @"SERVER\SQLEXPRESS,64256";
SqlConnectionStringBuilder scsBuilder = new SqlConnectionStringBuilder();
            scsBuilder.UserID = "log";
            scsBuilder.Password = "1111";
            scsBuilder.DataSource = server_adress;
            scsBuilder.InitialCatalog = "main_data";
            scsBuilder.IntegratedSecurity = false;

            con = new SqlConnection(scsBuilder.ConnectionString);

"User login failed."
Connection succeeds in SQL Management Studio

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yuuki Wesp, 2017-11-12
@AnotherAltr

64256and there is a port.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question