Microsoft Azure Essentials Fundamentals of Azure Second Edition e-optimized 5x11 pdf


ADO.NET Database connection string



Download 8,71 Mb.
Pdf ko'rish
bet185/260
Sana16.09.2021
Hajmi8,71 Mb.
#176022
1   ...   181   182   183   184   185   186   187   188   ...   260
Bog'liq
9781509302963 Microsoft Azure Essentials Fundamentals of Azure 2nd ed pdf

ADO.NET Database connection string 
Server=tcp:{your_db_server_name_here}.database.windows.net,1433;Database={your_db_name_here};User 
ID={your_username_here}@{your_db_server_name_here};Password={your_password_here};Encrypt=True;Tru
stServerCertificate=False;Connection Timeout=30; 
Note that the connection string sets the TrustServerCertificate property to False and the Encrypt 
property to True. This is to provide additional protection while accessing SQL Database over the 
Internet. Doing so helps thwart potential man-in the-middle attacks. SQL Database will force the 
connection to be encrypted regardless of the setting. 
When writing code against SQL Database, it is important to defend your code against transient errors. 
Transient errors are errors that are intermittent and likely will be resolved if the command is retried. 
These errors are more common with SQL Database than with databases accessed via a local area 
network (LAN). This is due to the inherently unreliable network that is the Internet and the fact that as 
a managed service, SQL Database might periodically undergo maintenance activities that could cause 
connections to drop temporarily. Applications should plan for and defend against transient errors by 
incorporating retry logic when creating connections or executing commands against SQL Database. 
Be sure to choose a retry strategy that provides sufficient time for the platform to attempt to recover 
from whatever caused the initial failure, does not saturate the platform with a rapid succession of retry 
attempts, and has a maximum number of retry attempts and/or retry duration. For example, an 
exponential back-off approach with a preset maximum number of attempts is often suitable—be sure 
to validate for your application scenario. 
For .NET applications using Entity Framework, Entity Framework 6 contains connection resiliency/retry 
logic that will detect transient errors from SQL Database and retry the command. For other .NET 
applications, Enterprise Library 5 and 6 (see 
http://msdn.microsoft.com/library/ff648951.aspx
) from 
Microsoft Patterns & Practices contain an application block called the Transient Fault Handling 
Application Block. This library can also be used to detect transient errors and retry commands. 
 
 


173 
CHAPTER 6  |    Databases 
 

Download 8,71 Mb.

Do'stlaringiz bilan baham:
1   ...   181   182   183   184   185   186   187   188   ...   260




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©www.hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish