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
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…