简体   繁体   English

使用静态IP将记录插入SQL Server

[英]Insert Record into SQL Server with static IP

I have a SQL Server database on a remote server which has a static IP address. 我在具有静态IP地址的远程服务器上有一个SQL Server数据库。 I want to insert a record from my local computer into my remote server using that static IP address in C#. 我想使用C#中的该静态IP地址将本地计算机中的记录插入到远程服务器中。

How I will make a connection string with the server and insert a record without using API? 如何在不使用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. 首先检查您与服务器IP的网络连接。 If the IP was available just create a normal query-string as you do always and in the data source put the IP address. 如果IP可用,则像往常一样创建一个普通的查询字符串,并在数据源中输入IP地址。 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. 如果不起作用,请检查数据库服务器防火墙是否在默认端口上接受请求,或者检查SQL Server侦听端口是否已更改并且不再使用默认端口。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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