I have a Customer table –> CustomerNumber and CustomerName columns
I have a Sales table –> CustomerName columns
I have a Label (represent CustomerNumber) and a DropDownList (represent CustomerName)
I getting to DropDownList Sales table –> CustomerName with SqlDataSource.
I want automaticly (with AutoPostBack) filling Label with CustomerNumber which CustomerName selected in DropDownList
Example SQL:
select A.CustomerNumber
from Customer A, Sales B
where B.CustomerName = DropDownList1.SelectedItems.Value
I’m thinking like this.
How can i do that?
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
}
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
}
What do ExecuteScalar do?