We will bind some data from the database and we are using SQLDataSource.
Initial chamber
Step 1: Open Visual Studio 2010 and create an empty website. Give a suitable name Listview_demo.
Step 2: In Solution Explorer you will get your empty website. Add a web form, SQL Database. By going like the following:
For Web Form:
Listview_demo (Your Empty Website) - Right Click, Add New Item, then Web Form. Name it Listview_demo.aspx.
For SQL Server Database:
Listview_demo (Your Empty Website) - Right Click, Add New Item, then SQL Server Database. Add Database inside the App_Data_folder.
Database chamber
Step 3: Go to your database Database.mdf, we will create a table - tbl_Data. Go to database.mdf - Table and add New table. Design your table like the following:
Table - tbl_data (Don’t forget to make ID, Identity Specification - Yes)
Show Table Data
Design chamber
Step 5: Now open your Listview_demo.aspx file, where we create our design for BINDING ListView using SQLDataSource.
ListView_demo.aspx
Output chamber Hope you liked this. Thank you for reading.