Sunday, February 12, 2012

Connecting to SQL Server over the LAN

Hello,
I have SQL Server installed on a machine named SQLHOST with an IP
address 192.168.1.4, and the SQL server is installed with the instance
named 'CLIENTDB'. Now on another machine, I have a client software
written using .NET which connects using the following string:
Server=SQLHOST\CLIENTDB;Initial Catalog=clients;User
ID=clientdb;Password=xyz;Trusted_connect
ion=false; Persist Security
Info=false;Pooling=false;
This works fine. But when I replace "SQLHOST" with "192.168.1.4" it
does not connect. Why is this? Is there no way one can connect with an
IP Address? As this is going to be deployed across the LAN, I would
rather rely on the IP address than the computer name... Does this make
sense?
Looking forward to your reply,
Thanks in advance,
JimHello Jim,
The instance name is significant in connecting to SQL Server. Try using 192.
168.1.4\CLIENTDB.

> I would
> rather rely on the IP address than the computer name... Does this make
> sense?
Yes, but not the way you are doing it. You'd be better off to get DNS setup
and going first so you can easily change the dotted-quad for SQLHOST without
having redeploy your app...
Thanks!
Kent Tegels
DevelopMentor
http://staff.develop.com/ktegels/|||Hello Kent,
Thank you for the quick reply.
I tried using 192.168.1.4\CLIENTDB but I get an error saying SQL
Server or instance name not found. The only way it has worked is by
supplying the computer name...
I can not set up a DNS system right now as we are very low on time.
Thanks again,
Regards,
Jim
On Mar 21, 4:15 pm, Kent Tegels <kteg...@.develop.com> wrote:
> Hello Jim,
> The instance name is significant in connecting to SQL Server. Try using 19
2.168.1.4\CLIENTDB.
>
> Yes, but not the way you are doing it. You'd be better off to get DNS setu
p
> and going first so you can easily change the dotted-quad for SQLHOST witho
ut
> having redeploy your app...
> Thanks!
> Kent Tegels
> DevelopMentorhttp://staff.develop.com/ktegels/

No comments:

Post a Comment