I have a dropdown list that binds data from a data reader bo I have a second
dropdown list in my wen form which I want to have same data, how can I copy
the one is bind to a secopnd one.. see my code below it dos not work..
Thanks
try
{
SqlConnection MyConnection = new SqlConnection();
MyConnection.ConnectionString = "user id=ScaleClient; password=
XXXAA;Initial Catalog=swatime;Data Source=Carbon";
MConnection.Open();
if(!IsPostBack)
{
SqlCommand MyCommand;
SqlDataReader MyReader;
String MySQL;
MySQL = "select * from clients";
MyCommand = new SqlCommand(MySQL,MyConnection);
MyReader = MyCommand.ExecuteReader();
//Fill Dropdownlist
FinOwnerList.DataSource = MyReader;
FinOwnerList.DataValueField = "ClientName";
FinOwnerList.DataBind();
// set Owner from Clients
PrjOwner.DataSource = MyReader;
PrjOwner.DataValueField = "ClientName";
PrjOwner.DataBind();
}
}