简体   繁体   中英

Save data value to SQL Server database over network or internet

I will like to try to build a Winform application with C# so I want to know how to save, update and delete data values to SQL Server over network or on the internet but not on local SQL Server database. Your help is certainly appreciated. Thanks in advance.

change your connection string to your sql server ip

if you don't know how to set , follow this How to set SQL Server connection string?

The update, delete or save of data values to a SQL server should be the same, you should just change the connection string and target the remote SQL server.

If you are using Entity Framework, you could change the connection string on your app.config.

  <connectionStrings>
    <add name="Context" connectionString="Data Source={Ip remote server};Initial Catalog=Context;Integrated Security=True;User ID=sa;Password=password" providerName="System.Data.SqlClient" />
  </connectionStrings>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM