sql server - How to deploy a C# windows form application that has database on another PC? -


I am trying to publish the c # windows form application, which contains approximately 15 forms, 4-5 datagrids, datasets etc. Are there. I have developed this app on my PC and has a database that has been developed on SQL Server 2012 (not express).

Now I want to run this app on another laptop, which is connected to my network on any LAN. I want to run this app on that laptop but still using the database on my laptop.

On my laptop, the connection string exists in App.config. Here is here:

     

Now how can I change the connection string so that it works on another laptop but still connect to DB on my laptop?

I hope you understand my question.

Regards.

Use the name of your laptop as bellow

  Source = myServerAddress;   

Or use your laptop or IP:

  data source = 192.0.0.1,1433;             P>  "ST" connection string = "data source = 192.0.0.1 \ SQLEXPRESS; initial catalog = ST; integrated security = true" provider name = "system.data. SQL client" />   

Unverified code :

  & lt; Add name = "ST" connection string = "data source = 1 9 02.0.1 \ SQLEXPRESS; initial catalog = ST; user id = myUsername; password = myPassword;" ProviderName = "System.Data.SqlClient" />   

You can enter Integrated Security = True to User ID = myUsername; Password = myPassword;

In addition, as the other answers have said, the server and laptop have to configure to accept remote connections.

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -