Display Data in GridView Using MySQL

Here we have to describe the process of an  ASP.NET  web site and use of the MySQL database. Display the data in GridView control. In this article we will create an ASP.NET website. By using the DropDownList and with the help of the GridView. So, Creating an ASP.NET web site. These steps help us to work with LINQ and  ASP.NET. So we have to follow these steps given below.

Step 1 : Open the Visual Studio menu>select>File>New>WebSite.

Step 2 : In Visual Studio select 
ASP.NET Web Site. Click Ok.

Step 3 : After Click we can see this page in either source or design view. Click the design view.

step 1.jpg

Step 4 : In the design view panel, enter some text (Test My Application) in the blank page.

step 4.jpg

Step 5 : Click on toolbox. Find the DropDownList. Drag and drop on the web page.

step 2.jpg

Step 6 : In a DropDownList context menu the enable AutoPostBack, check box is enabled.

step 3.jpg

Step 7 : Again in the Toolbox find and select the GridView control.

step 5.jpg

Step 8 : Drag and drop the GridView control to a location on the page. By default see this page as below.

step 6.jpg

Step 9 : We have to select columns in our GridView and choose database.

step 8.jpg

Step 10 :
In the GridView properties window we can set many of the formatting properties.

step 9.jpg

Step 11 :
Build the project and browse to the Default.aspx page on the browser to display the page as shown below.

img 17.gif


Here are some useful resources.

Up Next
    Ebook Download
    View all
    View all