I am filling a combobox with data from a table.
This is done with the code below.
After update of the combobox I want to fill txtField2 with data from Field2
in the select-statement.
How can I do that?
private void Page_Load(objec t sender, System.EventArg s e)
{
if (! Page.IsPostBack )
{
InitiateInstitu tion();
}
}
public void InitiateInstitu tion()
{
connName.Open() ;
SqlCommand cmd = new SqlCommand("SEL ECT Field1, Field2, Field3 FROM
tblInstitution ORDER BY Field1", connName);
SqlDataReader dr = cmd.ExecuteRead er();
cboInstitution. DataSource = dr;
cboInstitution. DataTextField = "Field1";
cboInstitution. DataBind();
dr.Close();
connName.Close( );
}
regards
reidarT