• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 464
  • Last Modified:

.NET 3.5 Sql Connection with SQL Server 2008 Multiple Instances Problem

So even though I've been working with SQL Server and .NET for years now, I'm running up against a fairly simple issue I just can't seem to figure out.

We have several .NET 3.5 applications that access a test SQL Server 2000 DB server....let's call it "orange", which resides in a different network. So our application Sql Connection strings' server names are "orange.network.edu" - note this doesn't use an instance name, per se.

And this works great and has worked great for years.

We are in the process of upgrading "orange" to SQL Server 2008 and have just finished migrating all of the DTS packages to SSIS. We migrated it alongside our existing test version of "orange" by creating a second instance of the test DB...which we'll call "orange\v2008". So the this second instance is "orange\v2008"...

The problem is that I can't find any information online as to the correct syntax for a FQDN for this second instance of the new DB - our applications won't connect to "orange.network.edu\v2008" or to "orange\v2008.network.edu". We need to use "orange.network.edu" because the name of "orange" by itself won't resolve properly.

The second instance is using port 1435, it is NOT being blocked by the firewall, the DB is allowing external connections. I have not yet tried an alias but that is my next step...but I'd like to get it to connect first without having to resort to the alias.

Any ideas? (If this doesn't make sense, let me know and I'll try better to explain in more detail.)

Thanks.
0
georgeb3
Asked:
georgeb3
  • 4
  • 3
1 Solution
 
MlandaTCommented:
Have you tried using the Alias? I think it's definitely going to be your best bet here...


Check: Sql Server Configuration Manager -> SQL Native Client 10.0 Configuration -> Aliases
0
 
dschauhan82Commented:
SqlConnection con = new SqlConnection("Server=You server name or comp name;Database=Yourdatabasename;Trusted_Connectopn=True");
please add this trusted connection property in your connection string.
http://msdn.microsoft.com/en-us/library/ms156468.aspx.
it may help you..

 
0
 
georgeb3Author Commented:
MlandaT, I think I will try the Alias option...at a minimum it will help as a diagnosis tool. If I create an Alias and the connection still doesn't work then there is most likely a network or permission issue going on behind the scenes with the new database. However, if the Alias does work maybe their is some weird network resolution/address issue going on.

dschauhan82...I will give that a try and see if that works.

Thanks, George
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
MlandaTCommented:
You can also just use the IP address of orange.network.edu like so:

xxx.xxx.xxx.xxx\v2008

to make:

data source=192.168.0.1\v2008;initial catalog=myDB;persist security info=False;user id=myUser;password=myPwd;
0
 
georgeb3Author Commented:
MlandaT...more info: I tried using the IP address and received a more detailed error message:

"A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)"

The instance name is correct - I double-checked.
The DB does allow remote connections - also checked that!
0
 
MlandaTCommented:
That error will normally only come about due to:

1) Firewall - make sure the SQL Server host machine allows access to that firewall (take note of antivirus firewalls as well, and scope of the firewall rules i.e. Private/Public/Domain
2) SQL Server configuration settings for remote connections.

In your case.. you will want to specify the port in the connection string as well...

Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword;

DBMSSOCN=TCP/IP. This is how to use TCP/IP instead of Named Pipes. At the end of the Data Source is the port to use. 1433 is the default port for SQL Server - http://www.connectionstrings.com/sql-server

Hope the little additional info helps :)
0
 
MlandaTCommented:
PS: Also make sure that the SQL Server instance is configured to use the TCP/IP Protocol.

Sql Server Configuration Manager -> Sql Server Network Manager -> Protocols for V2008
0
 
georgeb3Author Commented:
MlandaT,

Yes it is configured for TCP/IP...however it is setup for port 1435 since it is the second instance. I think it is a network issue since I can't telnet to port 1435 so I now have the network guys involved. Thanks for all of your input/suggestions...very helpful!

Just to clarify...the port is separated by the IP with a comma and not a colon in the connection string, right?

George
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

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