0

I developed a small application in C# Winforms with a SQL Server database. Now I want to deploy it where client is using server with SQL Server installed on it, and he wants to use the .exe file on another machine.

I need to make a connection so I added my database files in SQL Server and I changed my connection string to this:

public class DatabaseConnection
{
    private static string constring = @"Data Source=192.xxx.x.xxx\MYSRV;Initial Catalog=dbEmployee;User ID=sa;Password=sa$123";
    public static SqlConnection cn = new SqlConnection(constring);
}

but I still can't run my application - I keep getting this:

Error.

7
  • Do you have an instance of SQL Server at that IP named "MYSRV". Check out connectionstrings.com As a side note its not a good idea to use sa for user connections Commented Feb 2, 2016 at 8:07
  • Check the IP address of the SQL Server which hosts your database. Commented Feb 2, 2016 at 8:07
  • @bit i verified the ip address there is no problem with that. Commented Feb 2, 2016 at 8:12
  • Can you connect to the database using SSMS ? Commented Feb 2, 2016 at 8:17
  • yes, i checked the server machine and i used to the database with SSMS. Commented Feb 2, 2016 at 8:21

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.