0

Needs to connect application (C#-forms) on client PC with database on server (sql server 2014) i try this (this to make form to i can change from app without coding)

sqlconnection = new SqlConnection(@"Server=" + Properties.Settings.Default.server + "; Database=" + Properties.Settings.Default.database + "; Integrated Security=false; User ID=" + Properties.Settings.Default.ID + "; password="+ Properties.Settings.Default.password +"");

And i type data like this

tcp:PCNAME,port

sql_server_username

sql_server_password

It's working in server but when i try it on client PC didn't work .

HINT: (server username isn't same sql_server username)

D2rkZ3r0
  • 15
  • 4
  • You need to activate the connection on your server. try this: https://blogs.msdn.microsoft.com/walzenbach/2010/04/14/how-to-enable-remote-connections-in-sql-server-2008/ – billybob May 09 '17 at 21:58
  • check this, if it helps http://stackoverflow.com/a/5294741/1845593 – user1845593 May 09 '17 at 22:06
  • You may be interested in the class [`SqlConnectionStringBuilder`](https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnectionstringbuilder(v=vs.110).aspx) it lets you pass in parameters in to a connection string and will automatically format it correctly. [Example code](https://gist.github.com/leftler/98ef2d0ba8c211c0542c420ae769c10e). Also "It didn't work" is not enough information, you need to give us the exact text of the error message. use `.ToString()` on the exception to get the text to copy. – Scott Chamberlain May 09 '17 at 22:07
  • 1-I activated it and from setup choose mixed authantication. 2-The error is : Login failed for user 'servername/Guest'. – D2rkZ3r0 May 09 '17 at 23:11

0 Answers0