简体   繁体   中英

my c# windows form application and azure

i have an azure database and its connected to my c# application, i used App.config to create the connection string. when i run my program it becomes very slow, but when i connect to a local sql server its very fast. How do i make my azure connection on my application fast?

My App.Config

<?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>

It is likely to be a the network latency between your machine and Azure database. You can use certain network tools like ping , tracert , etc to see the network latency. You can then look at increasing your network connection speed (usually, via your ISP).

You can also select the Azure hosting that is closest to your location in which you are running your application

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM