I have developed a Windows Form Application in C# that uses SQL Server database connectivity. I developed it in .NET Framework 4.0 and SQL Server 2008 R2. My application is using a local database present in the root directory of the application called AG.mdf
.
This is my connection string:
Data Source=.;AttachDbFilename=|DataDirectory|\\AG.mdf;Integrated Security=True;User Instance=True
I created the installer by adding Setup Project inside Visual Studio installer template as a new project in my application. I build the Setup project and it created the installer for me. I deployed the application on my User's system, the application starts initially but then it suddenly pops up an error
Unhandled exception has occurred in your application. If you click continue, the application will ignore this message and attempt to continue. If you click quit, the application will close immediately.
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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
P.S: I have installed .NET Framework 4.0 and SQL Server Compact Edition on my User's system as well!
Should I quit programming :'(