SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 Other SQL Server Topics (2005)
 I need a help in connecting to remote database
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

moonshine
Starting Member

Egypt
3 Posts

Posted - 12/27/2011 :  05:00:50  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

5155 Posts

Posted - 12/27/2011 :  06:49:21  Show Profile  Reply with Quote
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

Egypt
3 Posts

Posted - 12/27/2011 :  07:22:10  Show Profile  Reply with Quote
just these two things ??
Do I need to add user and make it administrator or use windows authentication???

Edited by - moonshine on 12/27/2011 07:22:36
Go to Top of Page

sunitabeck
Flowing Fount of Yak Knowledge

5155 Posts

Posted - 12/27/2011 :  07:40:22  Show Profile  Reply with Quote
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

Egypt
3 Posts

Posted - 12/28/2011 :  07:29:41  Show Profile  Reply with Quote
ok , Thanks a lot :))
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000