使用C#将数据存储到远程SQL Server [英] Storing data to remote sql server using C#

查看:102
本文介绍了使用C#将数据存储到远程SQL Server的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好开发者:
如何使用SQL Server身份验证将数据从C#窗口应用程序保存到远程SQL Server?

实际上,我正在开发一个应用程序,在该应用程序中,我需要将产品交易保存到不是本地的远程计算机上,有人可以告诉我如何访问远程计算机并将数据保存在那里吗??

Hello Developers:
How can i save data from C# window application to the remote SQL Server with SQL server Authentication?

actually i am developing an application, in which i need to save the product transaction to the computer which is remote not local, can anyone when tell me how can i access remote computer and save data there...?

推荐答案

首先,解决方案1正常.除此之外,通过对服务器执行一次ping操作来检查.另外,在编写连接字符串之前,请使用@(Verbatim)
Firstly, Solution 1 is OK. Apart from that Check by pinging the Server once. Also, before writing Connection String use @ (Verbatim)


,其方式与您通常使用的方式完全相同.除了您的连接字符串将使用服务器名称或IP.例如:数据源= 1.2.3.45 \ MyCompany;初始目录= myDataBase;用户ID = myUsername;密码= myPassword;"
您应该确保服务器允许远程连接.
In exactly the same way as you would normally do. Except your connectionstring would use the server name or IP. For example: "Data Source=1.2.3.45\MyCompany;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;"
You should make sure the server allows remote connections though.


这篇关于使用C#将数据存储到远程SQL Server的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆