[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 187
  • Last Modified:

SQL Connect string specify protocol

I have Visual Studio C# application that for years has worked fine. Recently it stopped working and what I found out was that they had replaced servers. The new server has been assigned the same IP address as the old server. The error message leads me to believe that my application is trying to connect to the server via named pipes. We do not use named pipes it should be using TCP/IP. Unfortunately there is an application on the server that uses named pipes. I have an ini file that is read containing the connection string. Is there a way in the connect string to specify to use TCP/IP? I specify the IP address in my connect string and the old server has been taken off line.
0
rwheeler23
Asked:
rwheeler23
  • 5
  • 3
  • 2
2 Solutions
 
Carl TawnSystems and Integration DeveloperCommented:
What specifically is it you're trying to connect to?
0
 
ste5anSenior DeveloperCommented:
When it's a SQL Server connection: The connection string contains normally a Server value. In your case, when named pipes are used, it starts with the np prefix. Replace it.
0
 
rwheeler23Author Commented:
I have to pull data out of retail application that processes payment information. I can only assume they came out with a new version and sold my client a new server to go along with it. What my program does is extract check information.

Here is the connection string in an ini file I read
Data Source=MyDS;Initial Catalog=MyDB;User Id=sa;Password=MyPassword;Connection Timeout=60

The old server was taken offline and the new server replaced it with the same IP address. I can only assume the new version uses named pipes. How would I change this connection string to not try to use named pipes?
0
Independent Software Vendors: 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!

 
ste5anSenior DeveloperCommented:
Okay. Then you don't need to change the connection string, but you need to take a look at your ODBC data source named MyDS.

btw, I would not use a separate data source, when there is no real need for it.
0
 
rwheeler23Author Commented:
I do not understand. Check the ODBC data source for what? There is nothing in the definition of the ODBC data source that say only use TCP/IP. I have to use a separate datasource because the workstations that access this database use their datasource and I have on this one workstation only my application, not the retail application. So there is no other datasource. In the old SQL Server client you could specify which protocol but with the newer SQL Server Native Clients there is no such setting.
0
 
ste5anSenior DeveloperCommented:
Data Source=MyDS;

This parameter requires that you have created a data source using odbcad32. Depending on its configuration, you'll find the named pipes configuration here.
0
 
rwheeler23Author Commented:
Those options are only available using the old SQL Server client. Using the SQL Native Client does not allow for those options. My application requires the use of the 32 bit ODBC driver. Something has changed with this new server. I will try to use the old SQL Server client and force TCP/IP.
0
 
Carl TawnSystems and Integration DeveloperCommented:
Are you sure that whoever built the new server actually enabled TCP/IP for SQL Server? It isn't on by default.
0
 
rwheeler23Author Commented:
This other application has a small credit card component that must be using named pipes. That is what failed when I turned off named pipes on the server. The rest of it uses SQL as does my application.
0
 
rwheeler23Author Commented:
Thanks. I thought I closed this a long time ago.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 5
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now