gpt4 book ai didi

C# :Does Client machine need SQL Server installed on it while connecting to other machine having SQL Server installed on it (the Server machine)

转载 作者:太空宇宙 更新时间:2023-11-03 21:43:20 29 4
gpt4 key购买 nike

我写了一个 C# windows 应用程序表单,它在客户端机器上运行并连接到另一台机器上的 SQL 服务器。在 C# 中建立连接时,我使用了像这样的 dll

1)microsoft.sqlserver.management.smo。
2)microsoft.sqlserver.management.connectioninfo
3)microsoft.sqlserver.management.sdk.sfc

构建应用程序的客户端计算机上安装了 sql server。所以导入和访问 dll 不是问题。

但是,在我要运行 C# windows 应用程序的另一台客户端计算机上不会安装 SQL 服务器。

那么会不会出问题,会不会因为没有sql server导致那个客户端机器连接失败。

如果是,有什么方法可以在不在该客户端计算机上安装 sql server 的情况下解决问题。

PS:我事先询问以避免安装当天的最后一刻麻烦。

最佳答案

连接到 SQL 服务器所需的部分内置于 .net 框架中。只要您在编写客户端代码时使用了这些,您就可以连接到 SQL 数据库,而无需在客户端上安装 MSSQL。

using System.Data;
using System.Data.SqlClient;

SqlClient

PS: I am asking beforehand to avoid the last minute hassle on the day of installation.

您应该始终首先在本地进行测试。您可能会得到一台随机测试机器,以验证一切正常。

关于C# :Does Client machine need SQL Server installed on it while connecting to other machine having SQL Server installed on it (the Server machine),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18257719/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com