I have a C# WPF app running inside Visual Studio 2017 on my computer and I am using SQL Server 2014 to save/select data.
How can I run it on another Windows computer on the same network without installing Visual Studio / SQL Server? This app should read/insert data from/in my SQL Server.
I tried to using publish option, but the app isn't able to read data from my computer on other network pcs.
Also, I tried to copy bin to other pcs, but the app still isn't able to read data from SQL Server.
I already prepare SQL Server to receive a connection using the following steps on the following link:
app.config, I found the following connection string:
connectionString="Data Source=DESKTOP-QO2VUSP\SQLEXPRESS;Initial Catalog=AJFactory;Integrated Security=True"
I Checked the Event handler from other pcs, I find the following Errors:
Application: Factory App.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.Data.SqlClient.SqlException at System.Data.SqlClient.SqlInternalConnectionTds..ctor(System.Data.ProviderBase.DbConnectionPoolIdentity, System.Data.SqlClient.SqlConnectionString, System.Data.SqlClient.SqlCredential, System.Object, System.String, System.Security.SecureString, Boolean, System.Data.SqlClient.SqlConnectionString, System.Data.SqlClient.SessionData, System.Data.ProviderBase.DbConnectionPool, System.String, Boolean, System.Data.SqlClient.SqlAuthenticationProviderManager
And the following:
Faulting application name: Factory App.exe, version: 22.214.171.124, time stamp: 0x5bdb0efa Faulting module name: KERNELBASE.dll, version: 10.0.17134.319, time stamp: 0x5ea0e53d Exception code: 0xe0434352 Fault offset: 0x001117d2
The fact that it's a WPF application is irrelevant.
You need to change the connection string for your SqlConnection object. It will probably say something like "Data Source=Localhost" or "Data Source=127.0.0.1". This should be changed to the network name of your PC.
You will also need to check your Sql Server / Database configuration that another user has the correct access rights that this application needs.
Be aware of security type in the connection string you have:
works only if the two computers are in the same domain. I advise you to add UserName and Password for SQL in connectionString
You need to set
Integrated Security=False then When it false,you need to specified the
User ID and
Password in the connections string, For more info about Integrated Security, Check the following Answer:
User contributions licensed under CC BY-SA 3.0