3

I created a windows form application which is connected with a local sql server database. The sql server is windows authenticated.

Now I want to run same application on another computer which is connected to this computer via LAN. I just wanted to know the step by step process that allows to access my windows authenticated database on another computer.

1
  • 1
    Why does he need WCF or web API to connect another PC to a SQL Instance on the same LAN? Commented Mar 28, 2014 at 14:32

2 Answers 2

6

By default Remote connections in SQL Server Express is turned off.

Just turn on the remote connections for SQL Express, enable TCPIP protocal and restart the service, check errorlog whether it's listening on all network adapters Now try to connect using the machine name (since it's dynamic) from the client pc

here is a step

  • Open SQL Server Configuration Manager
  • Select SQL Server Network Configuration
  • Chose your instance of SQL Server
  • Make sure that TCP/IP protocol is enabled
  • Right click TCP/IP protocol
  • Select properties
  • Click IP addresses tab
  • Scroll down to IP4. The IP address of the server should be here. Set active to yes and enabled to yes. Set TCP port to 1433 (don't know if this is necessary. Can some expert comment)
  • Scroll down to IPAll. Set TCP port to 1433
  • Make an inbound firewall rule for port 1433
  • open sql server management studio, right click server instance, properties->connections-> allow remote connections. Security-> SQL Server and Windows Authentication mode
  • restart sql server service
  • restart sql server browser

now use sql connection string COMPUTERNAME for E.g

data source=COMPUTERNAME;database=databasename;user id=sa;password=pass;" providerName="System.Data.SqlClient"

Another reference link ..http://blogs.msdn.com/b/sqlexpress/archive/2005/05/05/415084.aspx

Sign up to request clarification or add additional context in comments.

4 Comments

But i am using Sql server 2008 r2
Sql Server Surface Area is not any option there
Now if i want to use windows authentication than will it be ok after these steps?? i Applied all of them except last
if u running diffrent domain then might be windwos auth. not work you .
1

I hope you have sql server authentication as well. If two of your computer are not in same domain, you need to use sql server authentication to connect from other computer.

Follow the step described by Anant Dabhi to turn on Surface area configuration. Now, you also need to change your connectionstring. Replace localhost or . in your current connection string by IP or computer name of the Machine where sql server is installed.

2 Comments

so you mean to say i need sql server authentication to do that. but i use windows authentication only
I am not sure that Windows authentication will work or not. But, Sql Authentication definitely works.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.