protected void TeamList() { ITeamInterface coachInterface = new TeamService(); var lst = coachInterface.GetTeamList().Select(x => new { x.TeamName, x.ID }).ToList(); DataTable dt = ToDataTable(lst); if (dt != null && dt.Rows.Count > 0) { TeamID.DataSource = dt; TeamID.DataTextField = "TeamName"; TeamID.DataValueField = "ID"; TeamID.DataBind(); } else { TeamID.DataBind(); } }
protected void TeamList()//This is teamlist method for binding the teams in dropdown { ITeamLogics coachLogics = new TeamLogics(); var lst = coachLogics.GetTeamList().Select(x => new { x.TeamName, x.ID }).ToList(); DataTable dt = ToDataTable(lst); if (dt != null && dt.Rows.Count > 0) { TeamID.DataSource = dt; TeamID.DataTextField = "TeamName"; TeamID.DataValueField = "ID"; TeamID.DataBind(); } else { TeamID.DataBind(); } }