G
Guest
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();
}
Any help is appreciated..
Thanks
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();
}
Any help is appreciated..
Thanks