jpchen
asked on
loop to get data from sql
Hi,
I want to have function will wait for the row has been release from SQL. It is still lock then I need to have loop to check every 10 seconds with through exception.
Thanks!
jpc
I want to have function will wait for the row has been release from SQL. It is still lock then I need to have loop to check every 10 seconds with through exception.
Thanks!
jpc
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I don't want to use other timer, I rember there is timeout value you can add to the connection string, but how to handle the timeout issue, there is what i am not sure what to do it.
Thanks!
jpc
Thanks!
jpc
to set the timeout on the connection string
myConnection.ConnectionTim eout = TheAmountOfTime;
myConnection.ConnectionTim
ASKER
thanks, but how to handle after timout?
SqlException is what I think it throws.
so do this.
try{
blah blah blah
}
catch(SqlException error)
then you can catch and handle the exception right there. Your app will know it failed. if it fails have it loop.
so do this.
try{
blah blah blah
}
catch(SqlException error)
then you can catch and handle the exception right there. Your app will know it failed. if it fails have it loop.
ASKER
Thanks, but how can I just catch the timeout error, I don't want to loop with other SQL issue.
ASKER