简体   繁体   中英

Insert Record into SQL Server with static IP

I have a SQL Server database on a remote server which has a static IP address. I want to insert a record from my local computer into my remote server using that static IP address in C#.

How I will make a connection string with the server and insert a record without using API? I will really appreciate any help.

use four part naming like below

insert into [192.16.1.20].[databasename].[schemaname].tablename
select * from tablename

First Check your network connection to the IP of server. If the IP was available just create a normal query-string as you do always and in the data source put the IP address. If it did not work check if the database servers firewall accepts requests on the default port or check if the SQL servers listening port has been changed and does not use the default port anymore.

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