?
Solved

Specify SQL connection port in ASP .NET machine.config

Posted on 2009-07-01
3
Medium Priority
?
506 Views
Last Modified: 2012-05-07
I would like to configure my SQL Servers to use non-standard TCP ports for incoming connections. Is there a way in my machine.config files used for ASP .NET development that I can specify a port the application should use in the connection string when connecting to my database server?
0
Comment
Question by:nbialaszewski_ons
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 15

Accepted Solution

by:
mohan_sekar earned 2000 total points
ID: 24756446

You could specify it as part of the connection string. Did I get your question right?
example:

"Provider=SQLOLEDB;" & "Data Source=<x.x.x.x>,<port number>;" & "Initial Catalog=<dbname>;" & "Network=DBMSSOCN;" & _     "User Id=<uid>;" & "Password=<pwd>"  
0
 

Author Comment

by:nbialaszewski_ons
ID: 24756502
So, the following should work? (I've used a connection string from my machine.config and changed some values)
<add name="ConnectionStringName" connectionString="Data Source=DBSERVER\MYINSTANCE,26500; Initial Catalog=DBNAME; Network Library=DBMSSOCN; User ID=SOMEUSERNAME; Password=XXXXXX"/>

Open in new window

0
 
LVL 15

Expert Comment

by:mohan_sekar
ID: 24756620
Yes, assuming your SQL Server listens on port 26500.
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question