Click to See Complete Forum and Search --> : Text box binding problem


prm
February 22nd, 2005, 10:20 AM
Hi,

I have a very simple problem. I have a drop down list which is bound to a
data command on page load. Now when the user selects a value from the drop
down list, another text box should be filled with the "Account No." from the
database for that Customer. But this is not happening...when i select a value
in the drop down, the text box doesnt display anything.

I think something is wrong with my code which is as follows::

private void ddlCustomer_SelectedIndexChanged(object sender,
System.EventArgs e)
{
sqlCommand2.Parameters["@vv"].Value=ddlCustomer.SelectedValue;
sqlConnection2.Open();
dr2=sqlCommand2.ExecuteReader();

dr2.Read();
txtAccount.DataBind();
txtAccount.Text= dr2.GetValue(0).ToString();

sqlConnection2.Close();
}

What's going wrong here?

Thanks for any help

prm
March 4th, 2005, 06:15 PM
Hi,

i found the problem...it was some problem with that web page only...it worked in another web page....
Thanks