1
這是我的xml文件如何綁定到XML GridView的
<ISPChecklist>
<Domain name="Coping Skills">
<Indicator>
Client shows impovement in either 1 of the areas listed below and shows reduction in frequency of inapporiate coping behaviors :
- anger management
- ability to make concrete plans about his/her future
- self percetion/self worth
- expand internal locus of control.
</Indicator>
<AttainmentDate></AttainmentDate>
<Remarks></Remarks>
</Domain>
</ISPChecklist>
這是我的網格視圖
<asp:GridView ID="ISPChecklist" runat="server"
OnRowDataBound="OnDataBound"
onselectedindexchanged="ISPChecklist_SelectedIndexChanged">
<Columns>
<asp:BoundField HeaderText="Domain" DataField= "Domain" />
<asp:BoundField HeaderText="Indicator" DataField="Indicator" />
<asp:TemplateField HeaderText="Date Of Attainment">
<ItemTemplate>
<asp:TextBox runat="server" ID="TB_Date" Columns="5"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Remarks">
<ItemTemplate>
<asp:TextBox runat="server" ID="TB_Remarks" Columns="5"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
這是我.cs文件
DataSet checklistDataSet;
string filePath = Server.MapPath("clientISPChecklist.xml");
checklistDataSet = new DataSet();
//Read the contents of the XML file into the DataSet
checklistDataSet.ReadXml(filePath);
ISPChecklist.DataSource = checklistDataSet.Tables[0].DefaultView;
ISPChecklist.DataBind();//errors occurs here
每當我運行此代碼集,我會收到一條錯誤消息,指出「在選定的數據源上找不到名爲」應對技能「的字段或屬性。 anyoen知道如何解決它?如果沒有任何教程或指南可用