Click here to Skip to main content
15,071,729 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hello all ,

i have now completed building my first ever simple winform application which is aimed for data entry.

the application is built using visual studio 2019 connected to MSSQL server 2012 which is installed on my system.

i need to now deploy this application and install the same in 4-5 systems , where the data entry done by them through my app should be updated in my MSSQL server (as they don't have mssql server installed)


can anybody please guide me how to do the same ..(any link for video or blog tutorial will also suffice)
kindly ask me if anything else is needed..

What I have tried:

this is my connection string:

<connectionStrings>
    <add name="dbcs" connectionString="Data Source=LENOVO\SQLEXPRESS;Initial Catalog=SQCData;User ID=ABCDE;Password=*****;Integrated Security=True"
        providerName="System.Data.SqlClient" />
Posted
Updated 21-Dec-20 22:37pm

First of all, you need to set up sql server to enable remote connections: Configure the remote access Server Configuration Option - SQL Server | Microsoft Docs[^]
After that other pc's will be able to see your sql server instance in LAN. If your sql server is out of the same LAN, you'll need to make more configurations (router, firewall, etc.).
Configure a Windows Firewall for Database Engine Access - SQL Server | Microsoft Docs[^]
Configure the Windows Firewall to Allow SQL Server Access[^]
SQL Server connection strings - ConnectionStrings.com[^]
   
Comments
Member 14898617 23-Dec-20 5:31am
   
sorry for being less clear in the question ..let me explain further so that you can help me ..

I have installed SQLEXPRESS in my system and built an app (winforms) in visual studio by creating a database in my sqlserver.

Now my application is complete , i have to install my app on my client(4-5 pc) all or on the same LAN and after installation when the user is trying to connect to my database located in my system he is getting below error:

System.Data.SqlClient.SqlException (0x80131904): 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. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, DbConnectionPool pool, String accessToken, Boolean applyTransientFaultHandling, SqlAuthenticationProviderManager sqlAuthProviderManager)

By searching online , i followed below points:

I have enabled Remote connection in my SSMS

I have TCP/IP in sql server configuration manager

I have created rule in firewall to allow port 1433

i then restarted sql server configuration manager

But when i opened TCP/IP window of Protocols of SQLEXPRESS in my sql server configuration manager , at the bottom TCP dynamic port was 12345(filled with other number) and my TCP port was empty.

I gain changed the TCP port to 1433 and cleared the number in TCP dynamic port and restarted SQL server services.

After all this when i reinstall the app in my client system i am getting the same error again , so please guide me if i am missing anything. And how to deploy winform Make Application With Database Can Access in Many Computers?
Maciej Los 23-Dec-20 6:07am
   
An error message is quite clear: "The server was not found or was not accessible". So, the name of sql server instance is badly spelled or your sql server does not enable remote connections. Please, read this: How to enum SQL Server instances in network[^]

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