I wrote a stored proc like that:
--------------------------------------------------------
declare @nTest as int
set @nTest = 100000
while @nTest > 0
begin
select * from MyTable
set @nTest = @nTest - 1
end
---------------------------------------------------------
And then in C#
try
{
SqlCommand cmd = new SqlCommand("TimeoutTest", m_dbConn);
cmd.CommandTimeout = 1;
cmd.CommandType = CommandType.StoredProcedure;
cmd.ExecuteNonQuery();
}catch(SqlException ex)
{
.....
}
But even 1 min later, it does not throw a exception. It should throw
a time out exception 1 second later, is it right?