There are few options to check what is the issue when running application on different pc or server. You con display exception details by using message box or write exception details to a log file. Then you know exactly what's happening in run time. Use try.. catch. Block to capture exceptions.
When you using integrated security in the connection, it will check whether application exciting user has privileges to sql server. If your application and sql server running in the same machine then integrated security will work most of the time. When you connect from different pc to sql server, make sure that windows user/executing domain user having pevileges to sql server or you can change to sql server authentication by using sql server user name and password in the connection string. Check
https://www.connectionstrings.com/sql-server/[
^] for connecting string formats