コード例 #1
0
        protected void BindStandingsGrid()
        {
            using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["default"].ConnectionString))
            {
                connection.Open();

                using (SqlCommand cmd = new SqlCommand("User_GetStandings", connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.Add(new SqlParameter("LeagueId", base.CurrentLeagueId));

                    IDataReader data = cmd.ExecuteReader();
                    standings_grid.DataSource = data;
                    standings_grid.DataBind();
                    try { standings_grid.HeaderRow.TableSection = TableRowSection.TableHeader; }
                    catch { }
                    data.Close();
                }

                connection.Close();
            }

            var groupings = LeagueService.ListTournamentGroupings(this.CurrentLeagueId);

            groupings_list.DataSource = groupings;
            groupings_list.DataBind();
        }