Install C # application with SQL Server database

2

I made a C # program of simple registrations using SQL Server 2008 database.

When I went to install another computer, I came across the following 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 correct and that SQL Server is configured to allow remote connections.

This is due to the fact that the server on which I am trying to install the application is different from the one I used to create it, so the connection instance is different. What should I do to be able to install my program on other computers?

    
asked by anonymous 01.08.2016 / 22:41

3 answers

1

In dev-best practices with client-server database, you must store the connection string inside the Web.config or App.config file. This is because, when you install the application on a second workstation, you can change this setting by editing the file to point to the database on the server.

Probably if you are already doing this, just change this connection string (connetionString) to the computer where the DB is.

    
21.11.2016 / 18:25
0

You will need a way to configure the connectionstring of your connection. The form of configuration depends on which component you used to make the connection to the database. In addition, it is also necessary to free the ports of the sql server in the firewall.

    
02.08.2016 / 01:58
0

Have you made an application that on every computer that is installed will need to connect to a local sql server?

If yes the best option would be to create a pro user option to map the database on first access.

    
02.08.2016 / 14:36