In this article, I will show you how to bind ListView Control in ASP.NET using C#.
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
Getting Started with ASP.NET 4.5 Web Forms and Visual Studio 2013