I have the following scenario;
Dim cmd as New SQLCommand
cmd.Connection = myopenconnection
cmd.CommandText = "usp_getdata"
cmd.Parameters.AddWithValue("@Year", 2008)
cmd.CommandType = StoredProcedure
Dim reader = cmd.ExecuteReader
The application get stuck and keep waiting for a response when the above is excuted. I have tryed to execute the SQL command from SQL Management studio and it works fine and on another copy of the database.
Very slow/not working code;
The problem was solved by modifiying the above code to;