C# Grid View From SQL Server DatabAse
C# Grid View From SQL Server DatabAse
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
Written By:
Saif ur Rehman
Assistant Professor, UIIT
PMAS Arid Agriculture University, Rawalpindi
[Type text]