Click here to Skip to main content
15,898,134 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

i have created a windows application in c# with sql database. i create a set up file, which is installed with no problems in my computer, but in other computer shows this messenge.

Unhandled exception has occumed in your application. lf you click Continue, the application will ignore this emor and attempt to continue. lf you click Quit, the application will close immediately A network-elated or instance-specific emor occumed while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is comect and that SQL Server is configured to allow remote connection provider: SQL Network Interfaces, emor: 52 nable to locate a Local Database Runtime installation. Verify that SQL Server Express is property installed and that the Local Database Runtime feature is enabled.)

What i have to do?? how can i fix it??

my connection string is this:

<add name="QFD_login.Properties.Settings.UsersDatabaseConnectionString" connectionstring="Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\UsersDatabase.mdf;Integrated Security=True" providername="System.Data.SqlClient">

What I have tried:

i have tried to change v11.0 to v12.0 but when i did, i couldnt open the app either to my pc..
Posted
Updated 21-Dec-16 22:22pm
v2

1 solution

make sure you have SQL server runtime of same version as ur DB path describes and same goes for SQL database files, on the PC u wanna run your application(version conflict can also cause this).

if you have, then search "services.msc" in windows startup. and run it as administrator. locate your SQL Server service restart/start it.
 
Share this answer
 
Comments
Muhammd Aamir 31-Dec-16 1:08am    
i think you should need to change the connection string according to your other computer

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