I tried to create SqlConnection object with connection string such as
SqlConnection con = new SqlConnection("Connection string");
However, when the program runs, exception happens, and the exception says
the keyword, port, is not supported.
So I change connection string from
server=server name;user id= user name;password=myPassword;persistsecurityinfo=False;database=Database name;Port=port number
to
server=server_name, portNum;user id= user_name;password=myPassword;persistsecurityinfo=False;database=Database_name;
or to
server=server_name: portNum;user id= user_name;password=myPassword;persistsecurityinfo=False;database=Database_name;
But I still have problems to connect to database.
Could anyone give me how to connect database with port number?
Sincerely,