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
 Other SQL Server Topics (2005)
 I need a help in connecting to remote database

Author  Topic 

moonshine
Starting Member

3 Posts

Posted - 2011-12-27 : 05:00:50
I have finished a program using sql server and visual studio using c# language .
I want to put the database on pc and the program that connected to that database on other PCs

I'm using this connection string in App.config :
<connectionStrings>
<add name="MWEConnectionString" connectionString ="integrated security=yes;initial catalog=MWDB;data source=.\sqlexpress"/>
</connectionStrings>


Should I change server name by pc external ip address??or what??
I don't know how to do it

Can any body help me with steps ,please?
thanks in advance

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2011-12-27 : 06:49:21
You should do at least two things:

First, change the source=.\sqlexpress to source=thepcname\sqlexpress (where "thepcname" is the network name of your pc).

Second, enable remote connections on the SQL server.

There are more detailed instructions here: http://support.microsoft.com/kb/914277
Go to Top of Page

moonshine
Starting Member

3 Posts

Posted - 2011-12-27 : 07:22:10
just these two things ??
Do I need to add user and make it administrator or use windows authentication???
Go to Top of Page

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2011-12-27 : 07:40:22
Do those two things and see if you are able to connect from a remote box to the server as a user who has administrative privileges. That is just to make sure that you are ABLE to connect.

Recommended practice is that users have only limited privileges - enough to do what they need to do. So once you have established that you are able to connect from remote computers, create users and grant them privileges on the database that they need to access. There are step by step instructions here: http://msdn.microsoft.com/en-us/library/aa337562.aspx Also look at the links at the bottom of that page.
Go to Top of Page

moonshine
Starting Member

3 Posts

Posted - 2011-12-28 : 07:29:41
ok , Thanks a lot :))
Go to Top of Page
   

- Advertisement -