Timeout error in sql server 2005 management studio express,is there a solution?
Posted on 2011-09-09
When I create a view such as 'select count(*) from sometable where....' the query times out after a minute. However, if I run the same query from FILE>NEW>QUERY WITH CURRENT CONNECTION it displays the count after 3 minutes. OR, if I modify the query to say, select * from sometable where... It runs fine.
THe error is, '.net sql data provider timeout expired'. Is there a solution? I've set all the timeouts available from the menu to infinite or a high number. I've opened c# and used the following code: SqlCommand cmd = new SqlCommand();
//cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandTimeout = 1200;