CS Code:
 1private void Page_Load(object sender, System.EventArgs e)    
 2{    
 3if(!Page.IsPostBack)    
 4{    
 5BindData();    
 6}
    
 7}
    
 8private void BindData()    
 9{    
10string XmlPath=Server.MapPath("Test.xml");    
11DataSet MyDs = new DataSet();    
12MyDs.ReadXml(XmlPath);    
13int RowsCount = MyDs.Tables[0].Rows.Count;//Get rows of DataSet's data;    
14for (int x = 0;x<RowsCount;x++)    
15{    
16MyDs.Tables[0].Rows[x]["src" ]=MyDs.Tables[0].Rows[x]["src"].ToString() + "This is added before Bind to controls";//Edit data ,you can do some other things here to edit data;    
17}
    
18this.myDataList.DataSource=MyDs;    
19this.myDataList.DataBind();//Bind data ,now,the data has been changed ;    
20myCn.Close();    
21}
    
22//Thats all;
posted on 2006-10-28 14:33  孙华勇  阅读(208)  评论(0编辑  收藏  举报