I am trying to execute a stored procedure that takes parameters and return a parameter. When I run the procedure separately in Management Studio everything works OK. But if I try to run the procedure from the code I am getting the "Execution Timeout Expired" error. I am suspecting that I am not passing the output parameter correctly:
List<SqlParameter> parameters = new List<SqlParameter>();
parameters.Add(new SqlParameter("@BankType", "Checking"));
parameters.Add(new SqlParameter("@VendorEmail", "vendorEmail@yahoo.com"));
parameters.Add(new SqlParameter("@ID", 12345));
SqlParameter outputParameter = new SqlParameter();
outputParameter.ParameterName = "@Confirm";
outputParameter.SqlDbType = System.Data.SqlDbType.Bit;
outputParameter.Direction = System.Data.ParameterDirection.Output;
parameters.Add(outputParameter);
myEntity.Database.ExecuteSqlCommand("exec TestStoredProc @BankType, @VendorEmail, @ID, @Confirm out", parameters.ToArray());