public static GameDetailCollection GetCollection() { GameDetailCollection tempList = null; using (SqlConnection myConnection = new SqlConnection(AppConfiguration.ConnectionString)) { using (SqlCommand myCommand = new SqlCommand("usp_GetGameDetail", myConnection)) { myCommand.CommandType = CommandType.StoredProcedure; myCommand.Parameters.AddWithValue("@QueryId", SelectTypeEnum.GetCollection); myConnection.Open(); using (SqlDataReader myReader = myCommand.ExecuteReader()) { if (myReader.HasRows) { tempList = new GameDetailCollection(); while (myReader.Read()) { tempList.Add(FillDataRecord(myReader)); } } myReader.Close(); } } } return(tempList); }
private void BindGameDetailList() { GameDetailCollection gameDetailList = new GameDetailCollection(); gameDetailList = GameDetailDAL.GetCollection(); rptGameDetailList.DataSource = gameDetailList; rptGameDetailList.DataBind(); }