Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8727637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:28:22+00:00 2026-06-13T08:28:22+00:00

My problem is trying to create a connection string in C# which connects to

  • 0

My problem is trying to create a connection string in C# which connects to a SQL Server 2012 database remotely. I can successfully do this if the machine hosting the SQL Server does not require a port number to navigate to. Now that we have re-routed our ip’s a little, the ip to the machine hosting SQL Server is XXX.XXX.XXX.XXX:16500, where SQL Server is still listening on default port 1433.

I understand you can specify the port number that the SQL Server instance is using like so;

data source=XXX.XXX.XXX.XXX,1433;Network Library=DBMSSOCN;initial catalog=Order;User ID=test1;Password=test1;");

Our problem is, that our remote machine is not just an IP. It is an IP and a port.

XXX.XXX.XXX.XXX:16500 would manually navigate to the desired PC, ignoring the port number would take you to another machine. We are trying to accomplish something like this;

data source=XXX.XXX.XXX.XXX:16500,1433;Network Library=DBMSSOCN;initial catalog=Order;User ID=test1;Password=test1;");

I cannot find for the life of me how to do this. I want to set my data source to a remote IP:PORT, as well as set the port SQL Server will be listening on (I understand 1433 is the default, but in some cases we may have to change it, so it needs to be there for the future)

I have tried;

data source=XXX.XXX.XXX.XXX:16500,1433;Network Library=DBMSSOCN;initial catalog=Order;User ID=test1;Password=test1;");

ERROR:

A network-related or instance-specific error occured while
establishing a connection to the SQL Server…

data source=XXX.XXX.XXX.XXX:16500;Network Library=DBMSSOCN;initial catalog=Order;User ID=test1;Password=test1;");

ERROR:

A network-related or instance-specific error occured while
establishing a connection to the SQL Server…

data source=XXX.XXX.XXX.XXX,16500;Network Library=DBMSSOCN;initial catalog=Order;User ID=test1;Password=test1;");

ERROR:

A connection was successfully established with the server, but then
an error occurred durring the pre-login handshake. (Provider: TCP
Provider, error:0 – An existing connection was forcibly closed by the
remote host.)

Here it seems I am just connecting to the wrong server, trying to use port 16500 for SQL Server, which is not correct.

Can anyone please shine some light, is this possible?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T08:28:23+00:00Added an answer on June 13, 2026 at 8:28 am

    This sounds like the IP address you have is actually a NAT device that forwards the traffic to another machine base on the port that was used to connect to it. If this is the case, you need to get your NAT administrator to create a public port on the NAT that will be forwarded to port 1433 on your SQL Server machine. Any port forwarding always only forwards to a single port, so what you were trying to do cannot work without that new forwarding rule being set up.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create this effect: http://www.thecssninja.com/demo/css_tree/ the problem I'm having is that the
I'm trying to create a client-server program that send and receive a string (its
I'm having a problem trying to create a Javascript function that checks all the
I'm having a pretty big problem trying to create navigation on my page. If
I'm running into a problem when trying to create an ArrayList in Java, but
have a nice day. I got problem when trying to create an image from
im stuck with a problem im basically trying to create a function where I
im trying to create offline desktop application. everything is working fine. The only problem
I am trying to create a simple drawing game like DrawSomething. The problem here
I am trying to create a notebook from my app. The problem is I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.