M
Maziar Aflatoun
Hi everyone,
I have dropdown list which I populate using ddl.DataBind(). However, I like
to initially add another DataValueField and DataTextField to the begining of
my dropdown list options. So that the end result would be my options in the
dropdown list + the ones read from the database table.
Ex.
ddlOwnerID.Items.Add("All"); // I like to add all as the first option.
ddlOwnerID.DataValueField = "OwnerID";
ddlOwnerID.DataTextField = "Username";
ReadSQL = "SELECT * FROM UserInfo";
SqlCommand Cmd = new SqlCommand(ReadSQL, Conn);
SqlDataReader rdr = Cmd.ExecuteReader();
ddlOwnerID.DataSource = rdr;
ddlOwnerID.DataBind();
Is that possible?
Thank you
Maz
I have dropdown list which I populate using ddl.DataBind(). However, I like
to initially add another DataValueField and DataTextField to the begining of
my dropdown list options. So that the end result would be my options in the
dropdown list + the ones read from the database table.
Ex.
ddlOwnerID.Items.Add("All"); // I like to add all as the first option.
ddlOwnerID.DataValueField = "OwnerID";
ddlOwnerID.DataTextField = "Username";
ReadSQL = "SELECT * FROM UserInfo";
SqlCommand Cmd = new SqlCommand(ReadSQL, Conn);
SqlDataReader rdr = Cmd.ExecuteReader();
ddlOwnerID.DataSource = rdr;
ddlOwnerID.DataBind();
Is that possible?
Thank you
Maz