Named Pipes alias in web.config

R

RichW

I'm trying to use a named pipes alias in a connection string in a
web.config file.

At the moment, my string looks like this:

"Application Name=test1;Data Source=richtest;Network=DBNMPNTW;Initial
Catalog=richdb1;Integrated Security=SSPI" />

I'm guessing that the problem is the "richtest" alias seems to just be
read as a DNS name - ie. I think it assumes it's a machine called
richtest and it tries to resolve that name to an IP address.

The richtest alias is set up in the SQL Client Network Utility as a
named pipes connection and works fine for other applications.

The connection string works if I use the actual pipe name
(\\richserver1\pipe\MSSQL$SQ2\sql\query), but I want to avoid doing
that if I can, just in case it changes. If I can use the alias, it
means I only have to change the alias if the database location
changes, and I don't have to worry about other things stopping working
because of hard-coded pipe names.

Any help with this would really be appreciated.


Rich
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top