1 namespace rowcountdemo
2 {
3 public partial class WebForm1 : System.Web.UI.Page
4 {
5 protected void Page_Load(object sender, EventArgs e)
6 {
7 List list = new List()
8 {
9 new Student(){Name="Li"},
10 new Student(){Name="Wang"},
11 new Student(){Name="zhang"},
12 new Student(){Name="qiao"}
13 };
14
15 GridView1.DataSource = list;
16 GridView1.DataBind();
17 }
18 }
19
20
21 public class Student
22 {
23 public string Name;
24 }
25 }