Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public SqlDataReader ExecuteDataReader(SqlCommand cmd)
- {
- try
- {
- OpenConnection();
- cmd.Connection = conn;
- cmd.CommandType = CommandType.StoredProcedure;
- SqlDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
- return dr;
- }
- catch (Exception ex)
- {
- Utils.Debug(string.Format("Err in {0}.{1} : {2}nSQL : {3}", this.GetType(), "ExecuteDataReader", ex.Message, cmd.CommandText));
- return null;
- }
- }
- Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.
- static void ProcessAssessmentCriteria(string UnitReference)
- {
- SqlCommand cmd = new SqlCommand("TRACKING.DBTool_GetUniqueAssessmentCriteriaByUnitReference");
- cmd.Parameters.Add("@UnitReference", SqlDbType.VarChar, 20).Value = UnitReference;
- SqlDataReader dr = db.ExecuteDataReader(cmd);
- if (dr.HasRows)
- {
- while (dr.Read())
- {
- ProcessDetailAssessmentCriteria(UnitReference, dr["AssessmentRefNumber"].ToString());
- Console.WriteLine("---------------");
- }
- }
- dr.Close();
- }
Add Comment
Please, Sign In to add comment