Sometimes their is a need to fill a Drop Down List from a database table. For that many beginners get into trouble trying to fill the DropDownList from database table. so by considering above requirement i have written this article for beginners, students and anyone who wants to learn how to fill a DropDownList from a database table.
Now let us start by creating a table named employee in the database as in:

I hope you have created the employee table in your database. Now insert records into the table as:
- insert into employee (FirstName) values ('vithal')
- insert into employee (FirstName) values ('Sudhir')
- insert into employee (FirstName) values ('virat')
- insert into employee (FirstName) values ('Pravin')
- insert into employee (FirstName) values ('Mayank')
Now let us start to create a Website as:
- Open Visual Studio from Start - - All programs -- Microsoft Visual Studio.
- Then go to to "File" -> "New" -> "WebSite..." then select Visual C# -> Web application.
- After that specify the name i.e Fill_dropdownlist or any name as you wish and the location of the project and click on the OK button. The new web site is created.
Use the following source code in the defualt.aspx <body> section page as:


Subhasis TripathyPosted Jul 17, 2020, 4:22 PM
Can u help me i want only particular data with respect to their id , data to be fetch and rest all the data should be in dropdown
Nomfundo CindiPosted Mar 7, 2017, 3:17 AM
Thank you it worked!
Vithal WadjePosted Jul 26, 2016, 10:19 AM
Concatenate all column of table in single like select Id+ Name+ City+ Gender as AliasNameAsYouwant from YourTable
Aparna ShuklaPosted Jul 26, 2016, 10:01 AM
How to get all 4 columns of a particular table in the DropDownList (ID,NAME,CITY AND GENDER)
veera muthuPosted Sep 11, 2015, 8:49 AM
How to select particular sql row using dropdownlist??
Vithal WadjePosted Apr 3, 2014, 3:06 PM
select id ':' Name from employee
mohammad baigPosted Apr 3, 2014, 7:25 AM
how can i get the records of employee id and name side by side in dropdownlist for exampleemployee id is: " 101" employee name is: "xyz" then how can i show the records like " 101: xyz " and this records coming from sql database table .