创建DataSet ,并放入Repeater过程_.NET_编程开发_程序员俱乐部

中国优秀的程序员网站程序员频道CXYCLUB技术地图
热搜:
更多>>
 
您所在的位置: 程序员俱乐部 > 编程开发 > .NET > 创建DataSet ,并放入Repeater过程

创建DataSet ,并放入Repeater过程

 2010/12/29 8:11:49  fhuan123  http://fhuan123.javaeye.com  我要评论(0)
  • 摘要:DataTabledt=newDataTable("test");DataColumndc1=newDataColumn("RegionSalesManID",typeof(System.String));DataColumndc2=newDataColumn("AreaCode",typeof(System.String));DataColumndc3=newDataColumn("AreaName",typeof(System.String))
  • 标签:Repeater DataSet 创建 过程 ASE

??????????? DataTable dt = new DataTable("test");
??????????? DataColumn dc1 = new DataColumn("RegionSalesManID", typeof(System.String));
??????????? DataColumn dc2 = new DataColumn("AreaCode", typeof(System.String));
??????????? DataColumn dc3 = new DataColumn("AreaName", typeof(System.String));
??????????? DataColumn dc4 = new DataColumn("AreaSalesManID", typeof(System.String));

??????????? dt.Columns.Add(dc1);
??????????? dt.Columns.Add(dc2);
??????????? dt.Columns.Add(dc3);
??????????? dt.Columns.Add(dc4);

??????????? DataRow dr1 = dt.NewRow();
??????????? dr1["RegionSalesManID"] = "aabbcc123";
??????????? dr1["AreaCode"] = "abc123";
??????????? dr1["AreaName"] = "FENGHUAN1";
??????????? dr1["AreaSalesManID"] = "ABC123";
??????????? dt.Rows.Add(dr1);

??????????? DataRow dr2 = dt.NewRow();
??????????? dr2["RegionSalesManID"] = "aabbcc124";
??????????? dr2["AreaCode"] = "abc124";
??????????? dr2["AreaName"] = "FENGHUAN2";
??????????? dr2["AreaSalesManID"] = "ABC124";
??????????? dt.Rows.Add(dr2);

??????????? DataRow dr3 = dt.NewRow();
??????????? dr3["RegionSalesManID"] = "aabbcc125";
??????????? dr3["AreaCode"] = "abc125";
??????????? dr3["AreaName"] = "FENGHUAN3";
??????????? dr3["AreaSalesManID"] = "ABC125";
??????????? dt.Rows.Add(dr3);

??????????? DataSet ds = new DataSet();
??????????? ds.Tables.Add(dt);
??????????? GetData = ds.Tables[0].DefaultView;
??????????? Repeater1.DataSource = ds;
??????????? Repeater1.DataBind();

发表评论
用户名: 匿名