R
Russ
I have a drop down list on a web page that I pre-fill onload from a SQL
table using a SqlDataReader.
The line of code that fills the drop down looks like this
while(myReader.Read())
{
ddlCompany.Items.Add(new ListItem(myReader["CompanyName"].ToString(),
myReader["CompanyID"].ToString()))
}
Now my problem is I have labels that I want to pre-fill with the information
from the first Company record in the table, but I am not sure how to do
that. If a user selects a different company from the drop down then I can
easily change all the labels in a SelectedIndexChanged event, but how can I
get them on the load of the page?
I hope what I am asking makes sense. Basically what I need to do is capture
all the data from the first record that the reader gets and output it into
the labels.
table using a SqlDataReader.
The line of code that fills the drop down looks like this
while(myReader.Read())
{
ddlCompany.Items.Add(new ListItem(myReader["CompanyName"].ToString(),
myReader["CompanyID"].ToString()))
}
Now my problem is I have labels that I want to pre-fill with the information
from the first Company record in the table, but I am not sure how to do
that. If a user selects a different company from the drop down then I can
easily change all the labels in a SelectedIndexChanged event, but how can I
get them on the load of the page?
I hope what I am asking makes sense. Basically what I need to do is capture
all the data from the first record that the reader gets and output it into
the labels.