Click here to Skip to main content
15,887,027 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
my db application works fine in my pc where i created my project. Now i test the project to another pc without sql server installed. My application cant access the record in my database [.mdf]. Can anyone check my connection string if it is correct. In, addition, im not accessing the database through network.. all i need is to run my application to other pc without sqlserver installed.

using:

msvisual studio 2010 and mssql server 2008 r2.

What I have tried:

string str = @"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|rhu.mdf;Trusted_Connection=True;Connect Timeout=30;User Instance=True";
Posted
Updated 2-Feb-18 0:35am

1 solution

If you need it to work without SQL Server installed then don't use SQL Server. Use SQL Server Compact, or SQLite, or even Access at a push, they can all be used without the need to install a server application on the client.
 
Share this answer
 
Comments
akosisugar 2-Feb-18 6:40am    
so does it mean, my problem cant be solve?
F-ES Sitecore 2-Feb-18 6:55am    
Yes, it means your problem can't be solved. Changing to SQL Compact should be fairly easy to do, probably only involving mainly a change in the connection string and for you to set up the tables etc again. The SQL will all still work.
akosisugar 2-Feb-18 6:58am    
ok thank sir..

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