if connecting to a sql database in C# what is the best way to ensure only a 30 second timeout max

if connecting to a sql database in C# what is the best way to ensure only a 30 second timeout max before an error msg is displayed?
alexatsearidgeAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
burakiewiczConnect With a Mentor Commented:
Sqlconnection.ConnectionTimeout=30;
0
 
Jaime OlivaresConnect With a Mentor Software ArchitectCommented:
this can be set in the connection string
0
All Courses

From novice to tech pro — start learning today.