数据库的值获取过来转换成Json数组的方法
.cs文件的主要代码: public class User_List //这个类是对应是Extjs的Grid的field里面的,field有几项就写几项 { public int VoteID = 0; public string VoteName = ""; public DateTime SystemDateTime = DateTime.Parse(DateTime.Today.AddDays(1).ToString("yyyy-MM-dd")); public DateTime EndTime = DateTime.Parse(DateTime.Today.AddDays(1).ToString("yyyy-MM-dd")); public string IsStatus = "禁用"; public int SubmitTimes = 0; }protected List<User_List> lst = new List<User_List>();//创建数组protected User_List userlst = new User_List();//定义的类设置对象for (int i = 0; i < limit; i++)//遍历获取值 { userlst = new User_List();//每次循环就新定义对象,不然复制的都是同一组值,每次覆盖原来复制的