G
Guest
Hi I have typed out the following codebehind:
private void Page_Load(object sender, System.EventArgs e)
{
clubconn=new SqlConnection(strClubconn);
dsClub=new DataSet();
string strClubSelect="SELECT Club_tbl.ClubName, Club_tbl.ClubID FROM
Club_tbl ORDER BY Club_tbl.ClubID Desc";
string strPositionSelect="SELECT Position_tble.PositionID,
Position_tble.PositionName FROM Position_tble ORDER BY
Position_tble.PositionID Desc";
string strAccessSelect="SELECT AccessGroup_tbl.AccessID,
AccessGroup_tbl.UserAccess FROM AccessGroup_tbl ORDER BY
AccessGroup_tbl.AccessID Desc";
clubconn.Open();
clubadapt=new SqlDataAdapter(strClubSelect,clubconn);
clubadapt.Fill(dsClub,"Club");
clubadapt.SelectCommand=new SqlCommand(strPositionSelect,clubconn);
clubadapt.Fill(dsClub,"Position");
clubadapt.SelectCommand=new SqlCommand(strAccessSelect,clubconn);
clubadapt.Fill(dsClub,"Access");
clubconn.Close();
Org.DataSource=dsClub;
Org.DataValueField=dsClub.Tables["Club"].Columns[1].ToString();
Org.DataTextField=dsClub.Tables["Club"].Columns[0].ToString();
Org.DataBind();
position.DataSource=dsClub;
position.DataValueField=dsClub.Tables["Position"].Columns[1].ToString();
position.DataTextField=dsClub.Tables["Position"].Columns[1].ToString();
position.DataBind();
AccessGroup.DataSource=dsClub;
AccessGroup.DataTextField=dsClub.Tables["Access"].Columns[0].ToString();
AccessGroup.DataValueField=dsClub.Tables["Access"].Columns[1].ToString();
AccessGroup.DataBind();
}
It is probably very wrong to assume I can one dataset with three different
tables to three different DropDownList controls but if it is possible can
someone tell me how?
I am Sam
private void Page_Load(object sender, System.EventArgs e)
{
clubconn=new SqlConnection(strClubconn);
dsClub=new DataSet();
string strClubSelect="SELECT Club_tbl.ClubName, Club_tbl.ClubID FROM
Club_tbl ORDER BY Club_tbl.ClubID Desc";
string strPositionSelect="SELECT Position_tble.PositionID,
Position_tble.PositionName FROM Position_tble ORDER BY
Position_tble.PositionID Desc";
string strAccessSelect="SELECT AccessGroup_tbl.AccessID,
AccessGroup_tbl.UserAccess FROM AccessGroup_tbl ORDER BY
AccessGroup_tbl.AccessID Desc";
clubconn.Open();
clubadapt=new SqlDataAdapter(strClubSelect,clubconn);
clubadapt.Fill(dsClub,"Club");
clubadapt.SelectCommand=new SqlCommand(strPositionSelect,clubconn);
clubadapt.Fill(dsClub,"Position");
clubadapt.SelectCommand=new SqlCommand(strAccessSelect,clubconn);
clubadapt.Fill(dsClub,"Access");
clubconn.Close();
Org.DataSource=dsClub;
Org.DataValueField=dsClub.Tables["Club"].Columns[1].ToString();
Org.DataTextField=dsClub.Tables["Club"].Columns[0].ToString();
Org.DataBind();
position.DataSource=dsClub;
position.DataValueField=dsClub.Tables["Position"].Columns[1].ToString();
position.DataTextField=dsClub.Tables["Position"].Columns[1].ToString();
position.DataBind();
AccessGroup.DataSource=dsClub;
AccessGroup.DataTextField=dsClub.Tables["Access"].Columns[0].ToString();
AccessGroup.DataValueField=dsClub.Tables["Access"].Columns[1].ToString();
AccessGroup.DataBind();
}
It is probably very wrong to assume I can one dataset with three different
tables to three different DropDownList controls but if it is possible can
someone tell me how?
I am Sam