Click here to Skip to main content
15,896,154 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
hello all

I have created a winforms application with internal database (service based database ).i am using service based database so that after setup don't need to connect and install sql server on client machine.

now my problem is when i create setup of application and install on my system its working fine. but when i install setup on other user machine and use form of application which connect with internal database than it showing error that network connection issue.

please help me anyone.

thanks

What I have tried:

i have changed connection string datasource .

< add name="localconnection" connectionstring="Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\Database1.mdf;integrated security=true;" providername="System.Data.SqlClient" />
Posted
Updated 2-Jul-19 21:52pm
v4
Comments
Michael_Davies 20-May-16 6:17am    
Please show the connection strings, remember we are not at your PC and cannot see what is happening.
Hemant Singh Rautela 20-May-16 6:22am    
Is you enable firewall for remote sql connection, where your database installed.
manvendra patel 20-May-16 6:39am    
my connection string is
connectionstring="Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=Database1.mdf;integrated security=true"

its work on my Development pc but when i run setup on client machine than getting connection error.how it possible on one system it work and on another system its not work.?
manvendra patel 20-May-16 6:40am    
please look at this link
http://stackoverflow.com/questions/30162076/net-cant-connect-to-mdf-on-another-machine
ZurdoDev 20-May-16 7:48am    
The exact error will tell you and us exactly what the issue is.

1 solution

Any attempt to use an SQL database requires access to a working SQL Server instance: your connection string is trying to establish a connection between your application and an instance of MS SQL on the same computer - that's what "(LocalDB)" means, it's an "execution mode" targetted at developers, not a way to access a DB without SQL Server installed. The string tries to start an SQL server instance as a stand alone entity to process only the DB file you are attaching. It still needs SQL Server installed and working!

If you want to use a DB without installing SQL Server, then you need to change your code to use a single user DB system, such as Access, SQLCE (Not recommended any more), or SqLite - none of which require more than a couple of DLL files which can be easily added to your application installation program.
 
Share this answer
 

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