Link to home
Start Free TrialLog in
Avatar of CumulusGranitus
CumulusGranitusFlag for Germany

asked on

Open two SQLConnections to same server from one application

I want to open two connections to different databases in the same server. Opening the first connection works, the second open always hangs and runs to connection timeout.

Form (VB.NET):

dim DbCon1 as new SQLConnection
dim DBCon2 as new SQLConnection

DBCon1.ConnectionString=" ...; Initial Catalog=Db1; ...."
DBCon2.ConnectionString=" ...; Initial Catalog=Db2; ...."

DbCon1.Open
DbCon2.Open <<---- hangs
ASKER CERTIFIED SOLUTION
Avatar of itmarsolutions
itmarsolutions
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of CumulusGranitus

ASKER

It was my mistake. The first connection i opened with "Data Source=LOCALHOST", the second with "Data Source=PCx\SQLEXPRESS" ...
If i open the second one with LOCALHOST too it works. Thanks for your hint.