drop down list control
Visual Studio
2
Posts
2
Posters
0
Views
1
Watching
-
is it possible in VS2003 to populate a dropdownlist control with data from a table in DB rather that manually entering values.....if yes how can we do that?
-
is it possible in VS2003 to populate a dropdownlist control with data from a table in DB rather that manually entering values.....if yes how can we do that?
You can try something like this: //Call Stored Proc and load values into a DataSet string conn = SqlHelper.GetConnectionString(); DataSet ds = SqlHelper.ExecuteDataset(conn, "spEmployeeRecords"); lstDropDownList.DataSource = ds; lstDropDownList.DataTextField = "FullName"; lstDropDownList.DataValueField = "EmployeeID"; lstDropDownList.DataBind();