我如何使用xmldocument对象填充数据集 [英] how i can fill dataset using xmldocument object
本文介绍了我如何使用xmldocument对象填充数据集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨..
请检查以下代码,让我知道我在哪里..
因为xmldoc包含数据,当我要将其填充到数据集中时,它不会填充.
Hi..
please check below code and let me know where i am missing..
because xmldoc contain data and when i m going to fill it in dataset it not filling it in.
Public Function RegisterComplaint(ByVal strInputXml As String) As String
Dim xmlDoc As New XmlDocument()
Try
xmlDoc.PreserveWhitespace = True
xmlDoc.LoadXml(strInputXml)
Catch e As Exception
Console.WriteLine(e.Message)
End Try
Dim cspParams As New CspParameters()
cspParams.KeyContainerName = "XML_ENC_RSA_KEY"
Dim rsaKey As New RSACryptoServiceProvider(cspParams)
Try
ClassXml.Decrypt(xmlDoc, rsaKey, "rsaKey")
Dim ds1 As New DataSet
ds1.ReadXml(New XmlNodeReader(xmlDoc))
Catch e As Exception
Console.WriteLine(e.Message)
Finally
rsaKey.Clear()
End Try
Return xmlDoc.OuterXml
End Function
当我使用xmldoc.save("file.xml")并找到
之类的数据时
as i used xmldoc.save("file.xml") and found data like
<Complaints>
<Table>
<UserID>1</UserID>
<Name>suhas</Name>
<Password>7DCB7FB26F37871F5E2A5D7A41A</Password>
<Email />
<LoginID>ssd</LoginID>
<Type>Others</Type>
<ACTIVE_FLG>A</ACTIVE_FLG>
<LAST_SIGN_IN>2008-06-20T10:23:28.717+05:30</LAST_SIGN_IN>
<LAST_PWD_CHG>2008-06-12T14:39:15.903+05:30</LAST_PWD_CHG>
</Table>
</Complaints>
如何在数据集中填充xmldocument?
在此先感谢...
How can i fill xmldocument in dataset??
thanks in advance...
推荐答案
请参阅以下链接..
将XML转换为强类型的数据集 http://www.beansoftware.com/ASP.NET-Tutorials/Using-XML.aspx
http://www.csharphelp.com/2005/12/processing-xml-documents -in-c/
Please refer these links..
Convert XML to Strongly Typed DataSets
http://www.beansoftware.com/ASP.NET-Tutorials/Using-XML.aspx
http://www.csharphelp.com/2005/12/processing-xml-documents-in-c/
这篇关于我如何使用xmldocument对象填充数据集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文