DataSet 读取xml文件

 DataSet ds = new DataSet(); ds.ReadXml(Server.MapPath(NetShop.Config.DbConfigs.GetSitePath + "images/flashdata/flash.config")); DataRow[] drs = ds.Tables[0].Select("", "[SortOrder] ASC"); //返回的是个DataRow[]: //DataRow[] dr=ds.Tables("FindFeatureOutputTable").Select("id>100") //object[] aArray = new object[intColumns]; //dr.ItemArray.CopyTo(aArray, 0); //dt.Rows.Add(aArray); //然后绑定dt.注意,上面的intColumns应该为dt的Column的Count. //DataView DV = ds.Tables("FindFeatureOutputTable").DefaultView; //DV.RowFilter = "id>100"; //Dg1.DataSource = DV; string sitewebpath = NetShop.Config.DbConfigs.GetSitePath; for (int i = 0; i < drs.Length; i++) { if (i > 3) { break; } else { piscs += sitewebpath + drs[i]["Path"].ToString() + "|"; links += drs[i]["Link"].ToString() + "|"; } } piscs = piscs.Trim('|'); links = links.Trim('|');

 

61f6d102-f95e-4ebe-a237-6c689797da07 images/flashdata/699362509650.jpg http://www.xxxx.com/ 旋转木马 转出幸福的味道 1 d9f7240d-8d1d-40d2-8df5-0c13c8eeb58a images/flashdata/700342962709.jpg http://xxxx.com/2009/ 限时抢购特惠天下有情人 2 b23fa0d9-936a-40d5-be5d-6326e34965df images/flashdata/701047818294.jpg http://localhost:6075/default.aspx 新年新气象免费 3 523528a4-e08f-483e-9fa7-eb972b26327d images/flashdata/702268599081.jpg http://xxx.com/Merchants.aspx 中国网购第一门户网商联盟全国火热招商 4

你可能感兴趣的:(dataset,xml,object,string,path,c)