Solved

Specify SQL connection port in ASP .NET machine.config

Posted on 2009-07-01
3
498 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

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

911 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

20 Experts available now in Live!

Get 1:1 Help Now