Solved

Specify SQL connection port in ASP .NET machine.config

Posted on 2009-07-01
3
494 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
  • 2
3 Comments
 
LVL 15

Accepted Solution

by:
mohan_sekar earned 500 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

758 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now