Click here to Skip to main content
16,004,927 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I use same window application in server and. server work fine but client working but sql database in server machine, client machine not access or connect server machine database. this server machine sql connection string -
XML
<add name="ConnectionStrings">
connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Soft SolutionASD\Soft Solution\Data\MediDataNew.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True" providerName="System.Data.SqlClient"</add>

plz suggest me how to connect client machine to server machine database. which type sql connection write in client machine.

ReplyQuick Reply
Posted
Updated 4-Nov-15 20:42pm
v2

You need to use Sql Server Authentication
Use the code
C#
Data Source={server ip}\SQLExpress;Database=TestDB;User Id=UserID;Password=myPassword;

and Make Sure TCP/IP is enabled on server from Sql Server Configuration Manager.
 
Share this answer
 
v3
You can't access remote SQL Server unless you made the required changes in the configuration.

Check these links-
How to access a SQL Server database from other computer[^]
How to: Enable Network Access in SQL Server Configuration Manager (SQL Server Express)[^]
Connecting from Another Computer[^]

Hope, these helps :)
 
Share this answer
 
v2
 
Share this answer
 
The first thing to notice is that your connection string uses a local instance of SQL:
Data Source=.\SQLEXPRESS
The "." says "This computer".
You need to change the connection string so it uses the actual name of the PC server hosting the SQL instance, and almost certainly you should not be using "integrated security", you should be using "proper" name and password combinations.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900