Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Express Edition and Compact Edition (2005)
 Connecting to Remote Database problem

Author  Topic 

Amjath
Yak Posting Veteran

66 Posts

Posted - 2007-01-03 : 01:53:59
Hi All,
I'm new using sql server 2005 express as the database.
Both the development and the database are in same machine as of now.

i use connection string as
SqlConnection test = new SqlConnection("server=AMJATHKHAN\\SQLEXPRESS;uid='';pwd='';database=TestDB;Trusted_Connection=yes;");

its working fine in my pc.
when i try to run the same executable in some other pc in the same lan it wont work..

the sql server express is accessible to all machine in the LAN.
then wat is the way to connect the remote sql server.

Is IIS Required for this Stuff.

plz help me.

With Regards
Amjath

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-01-03 : 02:49:18
Have you enabled Remote connections on SQL Express?

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

Amjath
Yak Posting Veteran

66 Posts

Posted - 2007-01-03 : 02:54:25
Hi harsh,
when i try to connect the db using sql server management studio express(other pc in the same network).

it will connect the database.

from this i taught that the remote connection get enabled in sql server express.

am i right or else i want to enable remote connection in sql server express

with Thanks and Regards
Amjath
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-01-03 : 02:58:08
While connecting from SSMS, are you using Windows Authentication or SQL Server Authentication mode?

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

Amjath
Yak Posting Veteran

66 Posts

Posted - 2007-01-03 : 02:58:41
Windows authenticated mode only
Go to Top of Page

mikewa
Microsoft SQL Server Product Team

84 Posts

Posted - 2007-01-04 : 12:46:03
Your connection string includes both the uid & pwd hints as well as the trusted connection = true hint, these are incompatible. If you are using Windows Authentication you should not be providing uid and pwd. I would expect this to result in the behavior you are seeing though. It is more likely you have not correctly configured SQL Express to accept remote connections. Check out http://support.microsoft.com/default.aspx?scid=kb;EN-US;914277 to verify that you've correctly configured both SQL Express and the Firewall on your computer.

Regards,
Mike Wachal
SQL Express

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
Go to Top of Page
   

- Advertisement -