C#Web应用程序未通过Azure混合连接连接到本地SQL Server [英] C# web app not connecting to on premise SQL Server through Azure hybrid Connection

查看:51
本文介绍了C#Web应用程序未通过Azure混合连接连接到本地SQL Server的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

到目前为止我已经采取的步骤

Steps that I've taken so far

  1. 我已禁用防火墙并配置了SQL Server以允许远程连接
  2. 验证混合连接管理器是否已建立连接
  3. 修改了连接字符串以指定TCP端口

如果您还有其他建议,请告诉我.

Please let me know if you have any further suggestions.

推荐答案

感谢您的答复,我终于弄明白了.我犯的错误是我指定了SQL Server名称和端口号(433中我的情况)仅在使用Azure时,并且在我的代码中,连接字符串后面仅提到了服务器名称.

Thanks for the replies, I've finally figured it out.The mistake i was making was that i was specifying the SQL Server Name AND port number(433 in my case) ONLY while deplying to azure and in my code behind the connection string only had the server name mentioned.

但是,当我在后面的代码中更新连接字符串以包括TCP端口时,我能够成功地将应用程序与Hybrid连接一起运行,以从SQL Server查询结果.

However when I updated the connection string in my code behind to include the TCP port, i was able to successfully run the app in conjunction with the Hybrid connection to query results from the SQL Server.

这篇关于C#Web应用程序未通过Azure混合连接连接到本地SQL Server的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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