-1

My objective was to make a database for general store. Information was very scattered about how to create database and why in that way. So i selected SQL Server Express. Application was made in C# Visual Stduio 2012. Database was created with SQL management Studio. To connect the application with database i used serverexplorer in visual studio and assigned ./sqlexpress

Now the problem is that database works fine on my pc but when i deploy application on the clients pc it says

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

Connection String Used connectionString = "Data Source=.\\SQLEXPRESS;Initial Catalog=pos;Integrated Security=True";

Where i went wrong ? Is database also deployed with published app or i have to do some other steps ? Will i have to install SQL server on client pc too? Note: The application is local. i don't need to transfer data via internet. Let me know according to your experince what is the right way to attach,create and deploy database the right way for this small project because internet is full of guide but there is no where mentioned properly why the specific method is adopted etc

sujith karivelil
  • 28,671
  • 6
  • 55
  • 88
Aj Jadoon
  • 31
  • 5
  • 2
    This is a common error, search for the error text and you can get plenty of results. Here could be one starting point http://stackoverflow.com/questions/18060667/why-am-i-getting-cannot-connect-to-server-a-network-related-or-instance-speci – Habib Jan 13 '16 at 15:32
  • The data source `.\SQLEXPRESS` expects to have a SQL server instance running on the *local machine*, with the instance name SQLEXPRESS. So the short answer is that, as you currently have it, you need to have SQL Server Express installed locally on any deployed machines. – Glorin Oakenfoot Jan 13 '16 at 15:32

1 Answers1

0

I solved the issue by download sql server management studio on client pc. I just made a backup of database form my management studio and restored that backup file from clients management studio. And now everything is working

Aj Jadoon
  • 31
  • 5