Something wrong with C# dropdown list
I can't seem to get my dropdown list to populate.
Webform:
Code Behind:
void ddl_DataBind()
{
SqlConnection SqlConn = new SqlConnection("server=c099450d01;uid=sa;pwd=;database=Tools");
SqlCommand SqlCmd = new SqlCommand("SELECT UID, LastName, FirstName FROM Employee ORDER BY LastName", SqlConn);
SqlConn.Open();
ddl.DataSource = SqlCmd.ExecuteReader(CommandBehavior.CloseConnection);
ddl.DataTextField = "LastName,FirstName";
ddl.DataValueField = "UID";
ddl.DataBind();
}
I don't get any errors, just that the dropdown list doesn't contain any data.
Thanks again for all your help.
Sincerely,
Tim

mikerRank #2,843 · 502 reputationPosted May 12, 2004, 4:20 AM EDT
timothy.farrell175 reputationPosted May 12, 2004, 5:06 AM EDT
timothy.farrell175 reputationPosted May 12, 2004, 5:20 AM EDT
mikerRank #2,843 · 502 reputationPosted May 12, 2004, 6:38 AM EDT
timothy.farrell175 reputationPosted May 12, 2004, 7:50 AM EDT
mikerRank #2,843 · 502 reputationPosted May 12, 2004, 8:49 AM EDT
timothy.farrell175 reputationPosted May 12, 2004, 9:04 AM EDT
timothy.farrell175 reputationPosted May 12, 2004, 11:55 AM EDT
timothy.farrell175 reputationPosted May 13, 2004, 5:57 AM EDT
timothy.farrell175 reputationPosted May 13, 2004, 6:54 AM EDT
timothy.farrell175 reputationPosted May 13, 2004, 7:39 AM EDT