protected void BindTeamList() { try { //Works TeamController sysmgr = new TeamController(); List <Team> datainfo = sysmgr.Team_List(); datainfo.Sort((x, y) => x.TeamName.CompareTo(y.TeamName)); TeamList.DataSource = datainfo; TeamList.DataTextField = nameof(Team.TeamName); TeamList.DataValueField = nameof(Team.TeamID); TeamList.DataBind(); TeamList.Items.Insert(0, "select ...."); TeamListV2.DataSource = datainfo; TeamListV2.DataTextField = nameof(Team.TeamName); TeamListV2.DataValueField = nameof(Team.TeamID); TeamListV2.DataBind(); TeamListV2.Items.Insert(0, "select ...."); } catch (Exception ex) { errormsgs.Add(GetInnerException(ex).ToString()); LoadMessageDisplay(errormsgs, "alert alert-danger"); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Session["TeamQuery"] = null; Session["TeamQueryRIDList"] = null; FormsAuthentication.SignOut(); string strConn = ConfigurationManager.ConnectionStrings["LoveCarrierConnectionString"].ConnectionString; SqlConnection myConn = new SqlConnection(strConn); try { myConn.Open(); String strSQL = @"SELECT TID, 'No.' + CAST([TID] AS CHAR(2)) + ' ' + [TeamMember1] + ' ' + [TeamMember2] AS TeamMember FROM [Team]"; SqlCommand myCommand = new SqlCommand(strSQL, myConn); using (SqlDataReader myDataReader = myCommand.ExecuteReader()) { TeamList.DataSource = myDataReader; TeamList.DataTextField = "TeamMember"; TeamList.DataValueField = "TID"; TeamList.DataBind(); } } finally { myConn.Close(); } } }
protected void BindTeamList() { try { TeamController sysmgr = new TeamController(); List <Team> info = sysmgr.Team_List(); info.Sort((x, y) => x.TeamName.CompareTo(y.TeamName)); TeamList.DataSource = info; TeamList.DataTextField = "TeamName"; TeamList.DataValueField = "TeamID"; TeamList.DataBind(); TeamList.Items.Insert(0, "Select a Team"); } catch (Exception ex) { ErrorMsg.Text = ex.Message; } }
protected void BindTeamList() { try { TeamController sysmgr = new TeamController(); List <Team> info = null; info = sysmgr.Team_List(); info.Sort((x, y) => x.TeamName.CompareTo(y.TeamName)); TeamList.DataSource = info; TeamList.DataTextField = nameof(Team.TeamName); TeamList.DataValueField = nameof(Team.TeamID); TeamList.DataBind(); TeamList.Items.Insert(0, "select..."); } catch (Exception ex) { MessageLabel.Text = ex.Message; } }
protected void BindList() { try { TeamController teamController = new TeamController(); List <Teams> listOfTeams = null; listOfTeams = teamController.List(); listOfTeams.Sort((x, y) => x.TeamName.CompareTo(y.TeamName)); TeamList.DataSource = listOfTeams; TeamList.DataTextField = nameof(Teams.TeamName); TeamList.DataValueField = nameof(Teams.TeamID); TeamList.DataBind(); TeamList.Items.Insert(0, "Select a Team"); } catch (Exception ex) { MessageLabel.Text = ex.Message; } }
protected void BindTeamList() { try { Controller01 sysmgr = new Controller01(); List <Entity01> info = null; info = sysmgr.List(); info.Sort((x, y) => x.TeamName.CompareTo(y.TeamName)); TeamList.DataSource = info; TeamList.DataTextField = nameof(Entity01.TeamName); TeamList.DataValueField = nameof(Entity01.TeamID); TeamList.DataBind(); TeamList.Items.Insert(0, "Select . . ."); } catch (Exception ex) { errormsgs.Add(GetInnerException(ex).ToString()); LoadMessageDisplay(errormsgs, "alert alert-danger"); } }
protected void BindTeamList() { try { TeamController teamController = new TeamController(); List <Team> teamInfo = null; teamInfo = teamController.Team_List(); teamInfo.Sort((x, y) => x.TeamName.CompareTo(y.TeamName)); TeamList.DataSource = teamInfo; TeamList.DataTextField = nameof(Team.TeamName); TeamList.DataValueField = nameof(Team.TeamID); TeamList.DataBind(); TeamList.Items.Insert(0, "Select a team..."); } catch (Exception ex) { //Message.Visible = true; errorMessageList.Add(GetInnerException(ex).ToString()); LoadMessageDisplay(errorMessageList, "alert alert-danger"); } }
protected void BindTeamList() { try { TeamController sysmgr = new TeamController(); List <Team> info = null; info = sysmgr.List(); info.Sort((x, y) => x.TeamName.CompareTo(y.TeamName)); TeamList.DataSource = info; TeamList.DataTextField = nameof(Team.TeamName); TeamList.DataValueField = nameof(Team.TeamID); TeamList.DataBind(); ListItem myitem = new ListItem(); myitem.Value = "0"; myitem.Text = "select..."; TeamList.Items.Insert(0, myitem); } catch (Exception ex) { ShowMessage(GetInnerException(ex).ToString(), "alert alert-danger"); } }