09 2011 档案

摘要://gridview数据绑定 if (daTable.Rows.Count == 0) { daTable.Rows.Add(daTable.NewRow()); GridView1.DataSource = daTable; GridView1.DataBind(); int nColumnCount = GridView1.Rows[0].Cells.Count; GridView1.Rows[0].Cells.Clear(); GridView1.Rows[0].Cells.Add(new TableCell()); GridView1.Rows[0].Cells[0].ColumnSp 阅读全文
posted @ 2011-09-15 08:40 一路遥遥 阅读(6027) 评论(0) 推荐(1)
摘要:public DataTable ToDataTable(IList list) { DataTable result = new DataTable(); if (list.Count > 0) { PropertyInfo[] propertys = list[0].GetType().GetProperties(); foreach (PropertyInfo pi in propertys) { result.Columns.Add(pi.N... 阅读全文
posted @ 2011-09-09 11:17 一路遥遥 阅读(313) 评论(0) 推荐(0)
摘要:首先要熟悉Json的数据格式: 比如包含两条记录的data表:表示为==data:[{sid:'TD411B-G54E49001',......},{......}] /// <summary> /// 将获取的Json数据转换为DataTable /// </summary> /// <param name="strJson">Json字符串</param> /// <returns></returns> public static DataTable JsonToDataTable( 阅读全文
posted @ 2011-09-09 10:52 一路遥遥 阅读(820) 评论(0) 推荐(1)