public static BallTypeCollection GetCollection() { BallTypeCollection tempList = null; using (SqlConnection myConnection = new SqlConnection(AppConfiguration.ConnectionString)) { using (SqlCommand myCommand = new SqlCommand("usp_GetBallType", myConnection)) { myCommand.CommandType = CommandType.StoredProcedure; myCommand.Parameters.AddWithValue("@QueryId", SelectTypeEnum.GetCollection); myConnection.Open(); using (SqlDataReader myReader = myCommand.ExecuteReader()) { if (myReader.HasRows) { tempList = new BallTypeCollection(); while (myReader.Read()) { tempList.Add(FillDataRecord(myReader)); } } myReader.Close(); } } } return(tempList); }
private void BindBallTypeList() { BallTypeCollection ballTypeList = new BallTypeCollection(); ballTypeList = BallTypeDAL.GetCollection(); rptBallTypeList.DataSource = ballTypeList; rptBallTypeList.DataBind(); }