什么是连接sql server remotelly的最佳方法 [英] What is the best way to connect sql server remotelly

查看:110
本文介绍了什么是连接sql server remotelly的最佳方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

01)我已经建立AC #Win表格申请

02)我在远程计算机上有这个应用程序主机的数据库

03)我安装此申请表不同的计算机在不同的位置(不同的城市)

和访问上面提到的数据库

04)我现在需要什么是使用示例代码与数据库交互的最佳方法。 。



请帮助我先生..

谢谢

01) I Have Build A C# Win Form Application
02) I Have A Database For This Application Host In A Remote Computer
03) I install This Application For Different Computer At Different Location (Different Cities)
And Access Above Mentioned Database
04) I Need To Now What is The Best Method For Interact With Database With A Sample Code..

Please Help Me Sir..
Thank You

推荐答案

您可以通过两种方式与数据库进行交互:

1.使用连接字符串直接将应用程序与数据库连接:

you can interact with database in 2 ways:
1. connect your application with the database directly by using connection string :
string connection_string = "Data Source=SERVERIP:PORT;Initial Catalog=databaseName;User ID=username;Password=userpwd;Integrated Security=false;"





2.托管网络服务将与t交互的服务器他的数据库。并从应用程序连接Web服务以对数据库执行操作。



2. Host a web service on the server which will interact with the database. and connect with the web service from your application to perform operation on database.


这篇关于什么是连接sql server remotelly的最佳方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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