1
我寫的代碼如下如何將Web服務輸出(XMLNode)轉換爲VB.NET中的數據集?
Dim xNode As XmlNode xNode = proclaimService.ProClaim_Get_Exclusions(sSQL) XmlData = New StringReader(xNode.OuterXml) Dim xmlString As String xmlString = xNode.OuterXml
在這裏,在的xmlString我得到以下
<NewDataSet xmlns="">
<Table>
<company />
<Policy>10163067</Policy>
<Rec_ty>Ex</Rec_ty>
<Seq_no xml:space="preserve"></Seq_no>
<Dt_last_updt>Dec 3 2003</Dt_last_updt>
<Coverage_no>All</Coverage_no>
<Client_no>65083406</Client_no>
<Document_name>Exclusion</Document_name>
<Print_ind />
<Retention_ind />
<Exclusion_type>Exclu</Exclusion_type>
<Comment01>blessure,maladie ou trouble d'un ou des deux genoux, y compr</Comment01>
<comment02>is les complications, traitements ou chirurgies connexes.</comment02>
<comment03 xml:space="preserve"></comment03>
<comment04 xml:space="preserve"></comment04>
<comment05 xml:space="preserve"></comment05>
<comment06 xml:space="preserve"></comment06>
<comment07 xml:space="preserve"></comment07>
<comment08 xml:space="preserve"></comment08>
<comment09 xml:space="preserve"></comment09>
<comment10 xml:space="preserve"></comment10>
</Table>
</NewDataSet>
我使用下面的代碼來創建數據集
XmlData = New StringReader(xmlString) reader = New XmlTextReader(XmlData) xmlDs.ReadXml(reader) Dset = xmlDs
但在XmlData中,我沒有得到任何東西..... 如何將其轉換爲使用VB.NET的數據集?
你從文件中讀取? – dbasnett
@dbasnett no ...我正在從webservice得到xml字符串,這是返回XmlNode – abhayk
更新我的答案。注意返回的表的數量。我測試的網站返回了14 ... – dbasnett