User u = new User();
List<User> list = new List<User>();
u.Id = 1;
u.LoginName = "Mr.Han";
u.PassWord = "123456";
u.Name = "韩先生";
list.Add(u);
u.Id = 2;
u.LoginName = "Mr.HanHe";
u.PassWord = "123456";
u.Name = "赫先生";
list.Add(u);
gvUserInfo.DataSource = list;
你只new了一个user对象。
那怎么创建User的对象
@灬丶: User u2 = new User();然后添加u2