Click here to Skip to main content
15,886,737 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I was unable to google this.

I need to publish my windows form application project that has a microsoft sql server database.

I was able to publish it and install the project in a different computer but the database was not published with it. How do I publish the project with the database included?

Here's the error:

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 connect and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error 26 - Error Location Server/Instance Specified)

BTW, i'm using Visual Studio 2015, Microsoft SQL server 2016, and SAP Crystal Reports.

What I have tried:

I tried to search google on how to solve my problem but to no avail. I need help. Thnx!
Posted
Updated 9-Oct-16 5:54am
v2
Comments
[no name] 9-Oct-16 10:20am    
"I was unable to google this", why not? The error "The server was not found or was not accessible" is perfectly clear. Did your user install SQL Server? Is SQL Server running? Is it configured correctly? Does your connection string contain the correct server name?
Paolo Tansengco 9-Oct-16 10:56am    
SQL server is not installed in the user's computer. What I want to happen is to include the database files in the published Visual Studio project. So that after installing the program in the user's computer, it would work instantly. or is that not possible?
[no name] 9-Oct-16 11:17am    
No it's not possible to use SQL Server without actually having SQL Server installed.
Paolo Tansengco 9-Oct-16 11:52am    
That's why. Thanks, I think I know what to do.
PIEBALDconsult 9-Oct-16 13:20pm    
And please do not attempt to have SQL Server (or any other application) automatically install with your application.
You do not know what the user's system/environment is like -- the user may have SQL Server available on a separate server and he may want to attach the database there.
Do be sure that the user can configure the system as needed -- e.g. do not hard-code "localhost" as the server.

1 solution

Try adding it as prerequisite of your project.
Have a look on the following documentation
https://msdn.microsoft.com/en-us/library/7eh4aaa5(v=vs.100).aspx[^]

In case you find difficulties while applying the steps as described in the documentation, please let me know.

Hope, it helps :)
 
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