-4

I need to make desktop apps that connect to main SQL Server database on one server computer. So I need to know how to connect C# Winforms application that connects to database on other computer via local network.

Please guys I need tito and videos if you have.

Dale K
  • 25,246
  • 15
  • 42
  • 71
  • 6
    What have you researched, what have you tried, what didn't work for you, what errors are you getting. This isn't a programming problem, its a research problem – TheGeneral Nov 19 '19 at 08:32
  • I need to know how to make C# apps connect to one sql server database – ala bouhajja Nov 19 '19 at 08:35
  • 1
    imagine you are connecting your c# winforms database instance on local computer, do the same but change the sql instance ip address to the other computer database, and allow firewall to access LAN connections. (some others has answer some thing similar (https://stackoverflow.com/questions/20558043/the-right-connection-string-for-remote-sql-server-for-c-sharp/20559711#20559711) – Maytham Fahmi Nov 19 '19 at 08:36
  • you can read about it by searching online. one link for your reference: https://www.codeproject.com/tips/212006/connecting-windows-form-application-with-ado-net-i – Venkataraman R Nov 19 '19 at 08:46

1 Answers1

0

In your app.config set your connection string like below.

<connectionStrings>
    <add name="MyDBConnectionString" providerName="System.Data.SqlClient"
        connectionString="Data Source=[Remote Server Name]/SQLInstanceName;Initial Catalog=[DataBaseName]; Integrated Security=true" />
</connectionStrings>  
Dale K
  • 25,246
  • 15
  • 42
  • 71
Syed Wahhab
  • 154
  • 1
  • 1
  • 13