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