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?
 
burakiewiczCommented:
Sqlconnection.ConnectionTimeout=30;
0
 
Jaime OlivaresSoftware ArchitectCommented:
this can be set in the connection string
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.