Solved

Specify SQL connection port in ASP .NET machine.config

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

Free eBook: Backup on AWS

Everything you need to know about backup and disaster recovery with AWS, for FREE!

Question has a verified solution.

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

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…
In this article I will describe the Backup & Restore 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.
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

690 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