public static DrawingNumbersCollection GetCollection() { DrawingNumbersCollection tempList = null; using (SqlConnection myConnection = new SqlConnection(AppConfiguration.ConnectionString)) { using (SqlCommand myCommand = new SqlCommand("usp_GetDrawingNumbers", myConnection)) { myCommand.CommandType = CommandType.StoredProcedure; myCommand.Parameters.AddWithValue("@QueryId", SelectTypeEnum.GetCollection); myConnection.Open(); using (SqlDataReader myReader = myCommand.ExecuteReader()) { if (myReader.HasRows) { tempList = new DrawingNumbersCollection(); while (myReader.Read()) { tempList.Add(FillDataRecord(myReader)); } } myReader.Close(); } } } return(tempList); }
private void BindDrawingNumbersList() { DrawingNumbersCollection drawingNumbersList = new DrawingNumbersCollection(); drawingNumbersList = DrawingNumbersDAL.GetCollection(); rptDrawingNumbersList.DataSource = drawingNumbersList; rptDrawingNumbersList.DataBind(); }