EF执行存储过程时超时问题
public DataSet ExecuteProcedure(string Procedure, IDataParameter[] parameters) { using (ContextEntities Entities = new ContextEntities()) { using (Entities.Database.Connection.CreateConnectionScope()) { var cmd = Entities.Database.Connection.CreateCommand(); cmd.CommandTimeout = 5000; cmd.CommandText = Procedure; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddRange(parameters); SqlDataAdapter f = new SqlDataAdapter(cmd as SqlCommand); DataSet ds = new DataSet(); f.Fill(ds); return ds; } } }