mbiro
Programmer
- Nov 20, 2001
- 304
How do I have my code wait for a response from a database call for a certain length of time before it gives up and moves on? When my code below hits the executequery, it waits for a response. If there is an error on the db side, my code waits indefinitely. I need it to give up after, say, 30 seconds. Any ideas? (This is a connection to an AS400 iSeries, but I assume it wouldn't matter to what I was connecting)
Dim drReader400 As iDB2DataReader
ConnStr400.Open()
Dim cmd1 As iDB2Command = New iDB2Command(ConfigurationSettings.AppSettings("iSeriesLibrary") + ".SP60150EOL", ConnStr400)
cmd1.CommandType = CommandType.StoredProcedure
cmd1.ExecuteNonQuery()
Dim drReader400 As iDB2DataReader
ConnStr400.Open()
Dim cmd1 As iDB2Command = New iDB2Command(ConfigurationSettings.AppSettings("iSeriesLibrary") + ".SP60150EOL", ConnStr400)
cmd1.CommandType = CommandType.StoredProcedure
cmd1.ExecuteNonQuery()