Filling GridView Using C-Sharp Code
Filling GridView Using C-Sharp Code
[Type text]
To fill a grid view using the C-Sharp code, we have to follow these steps
Steps are:
[Type text]
Select Class, and rename it as DAL.CS
This will add a new class named DAL.CS under app_code folder as shown here
[Type text]
Add the following line of code as highlighted in the figure below
Next, declare a variable of type string as shown in the highlighted line below
[Type text]
Add the method as shown in the figure in the indicated space
[Type text]
Drop and drag the GridView from the tool box in between <div> tag as shown
[Type text]
Now, open the default.aspx.cs file from the solution explorer
[Type text]
Now add the line as shown in the highlighted line
[Type text]
Now, run the application and see the output
By:
Assistant Professor
Email: [email protected]
[Type text]