怎么把客户端从webservice获得的xml转换成recordset?
如题。
webService的函数如下:
VB.NET code:
Public Function RecordSetBySql(ByVal Sql As String) As XmlDataDocument
Dim xRs As ADODB.Recordset
Dim cmd As ADODB.Command
Dim st As Stream
Dim xd As XmlDataDocument
xRs = New ADODB.Recordset
cmd = New ADODB.Command
st = New Stream
xd = New XmlDataDocument
xRs.Open(Sql, SDConn, CursorTypeEnum.adOpenDynamic, LockTypeEnum.adLockOptimistic)
xRs.Save(st, PersistFormatEnum.adPersistXML)
st.Flush()
st.Position = 0
xd.LoadXml(st.ReadText(st.Size))
st.Close()
xRs.Close()
conn.Close()
Return xd
End Function
{{
相关问答:
从数据库中查询一张表的数据
select 部门,姓名 from tb
如何才能生成下面的xml格式
XML code:
<folder state="unchecked" label="全部">
<folder state="unchecked&qu ......
现在有个xml文件是<?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
xm ......
XML文件内容:
- <ResList>
<page>0</page>
- <resItem>
<resName>WWW</resName>
</resItem>
- <resItem>
&nb ......
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<id="1">
<user="test1" pass="12345" />
& ......
如题,我想用dom4j来读取xml的文件
public Document read(String fileName) throws MalformedURLException, DocumentException {
SAXReader reader = new SAXReader();
Document document = read ......