Solved

Specify SQL connection port in ASP .NET machine.config

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SSIS Standard Template for Reuse by Business Units 12 48
find SQL job run average duration 24 57
How to keep a record with the highest value 3 40
Database Owner 3 21
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 …
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

733 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