1
我正在使用SQL Server和VB.NET。在我的SQL我使用以下內容:在.NET中讀取XML架構和數據
select top 1 * from tablename where 1=0 for xml auto, type, xmlschema
獲取表名模式。然後我用
select * from tablename where ID=1 for xml, auto, type, elements xsinil, root('xml')
得到我感興趣的數據行。
如果我使用在VB以下代碼:
Private ds as New Dataset
ds.ReadXMLSchema("xmlschema.txt")
我結束了含有一個表具有正確定義的一組列
的DS如果我然後嘗試:
ds.ReadXML("xmldata.txt")
代碼成功,但我的數據集表中沒有任何行。
我的問題是,我需要做什麼才能將SQL Server創建的xml數據讀入SQL Server指定的模式的數據表中。