c# - 我的 C# Windows 窗体应用程序和 azure

标签 c# azure

我有一个 azure 数据库,它连接到我的 C# 应用程序,我使用 App.config 创建连接字符串。当我运行我的程序时,它变得非常慢,但是当我连接到本地 SQL 服务器时,它非常快。如何在我的应用程序上快速建立 azure 连接?

我的应用程序配置

<?xml version="1.0"?>
<configuration>
  <configSections>
  </configSections>
    <connectionStrings>
  <clear />
  <add name="fudz" connectionString="Data Source=[my server];Initial Catalog=[databasename];Persist Security Info=True;User ID=[my user name];Password=[my password];Encrypt=true;TrustServerCertificate=False;Connection Timeout=30;"/>
</connectionStrings>
<startup useLegacyV2RuntimeActivationPolicy="true"><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1"/></startup></configuration>

最佳答案

这可能是您的计算机和 Azure 数据库之间的网络延迟。您可以使用某些网络工具,例如 pingtracert 等来查看网络延迟。然后,您可以考虑提高网络连接速度(通常通过您的 ISP)。

您还可以选择距离您运行应用程序的位置最近的 Azure 托管

Azure 位置 - https://azure.microsoft.com/en-us/regions/?cdn=disable

关于c# - 我的 C# Windows 窗体应用程序和 azure,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44718589/

相关文章:

c# - MSTest 自定义测试通过消息

azure - Azure 上的 JetBrains DotTrace 远程分析

api - Bing 搜索 API 在您的市场中不可用

azure - 使用 Azure CLI 将 Azure 标记参数传递到 Bicep 模板

c# - ASP.NET 自定义登录

C# WebClient - DownloadString 编码错误

azure - Azure 服务总线中的消息和事件消息之间的区别

azure - 使用具有托管标识的 Azure Web App for Containers

c# - MonoTouch - 线程

c# - 纬度经度对的正则表达式