c# - 如何在运行 SQL Server 的虚拟机上创建 connectionString 以将 ado.net c# 连接到
问题描述
我在连接到在虚拟机(virtualbox)上运行的 SQL Server 时遇到了一些困难。我在 C# 中使用 ADO.NET 通过连接字符串进行连接,但我没有成功。
我的app.config
文件如下所示:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
<connectionStrings>
<add name="AP3"
connectionString="Data Source=190.166.2.8,1433;Initial Catalog=AP3;
User Id=sa;Password=PasswOrd;"
providerName="System.Data.SqlClient" />
</connectionStrings>
</configuration>
我不知道我是不是做错了什么...
解决方案
您似乎不允许使用 Sql Server 进行远程连接。请点击此链接了解更多详情
推荐阅读
- r - 在 R 中抑制来自 Keras 的控制台输出
- java - 从弹性搜索的 JSON 响应中形成自定义 JSON 对象
- java - JavaEE、Servlet 创建文件夹中文件的链接
- swift - Travis 运行所有方案,但只希望运行一些方案
- html - 绝对定位的 div 内部位置:相对溢出:滚动 div
- sql - 通过执行舍入函数更新列值
- c# - 如何从脚本 C# Unity 将参数传递给 EventTrigger 中的方法
- woocommerce - 不显示特定的 woocommerce 类别
- mongodb - 无法恢复数据库
- angular - 解析器发出错误`错误错误:“[object Object]”`