<?xml version="1.0" encoding="UTF-8"?>
<searchResult>
<pagination>
<itemsPerPage>{Number of Inventories per Page}</itemsPerPage>
<numberOfItems>{Number of Inventories}</numberOfItems>
</pagination>
<itemList>
<item>
{Requested Salesforce fields e.g:}
<Id>{Salesforce Id}</Id>
<Name>{Name}</Name>
<pb__IsForSale__c>{e.g.}false</pb__IsForSale__c>
<pb__IsForLease__c>{e.g.}true</pb__IsForLease__c>
<pb__ItemDescription__c>{Item Description}</pb__ItemDescription__c>
<pb__PurchaseListPrice__c>{Item List Price e.g.:}2000000.00</pb__PurchaseListPrice__c>
<CurrencyIsoCode>{Currency Iso Code e.g:}EUR</CurrencyIsoCode>
<pb__UnitBedrooms__c>{Number of Bedrooms}</pb__UnitBedrooms__c>
<asset>
<Id>{internal Propertybase InventoryAsset Id}</Id>
<category>{Images, Videos or Documents}</category>
<isExternalLink>false</isExternalLink>
<title>{title}</title>
<filename>{original name of the uploaded file}</filename>
<url>{full url to image/video/document}</url>
<thumbnailUrl>{full url to thumbnail image}</thumbnailUrl>
<midresUrl>{full url to thumbnail image}</midresUrl>
<tags>{comma separated tags}</tags>
<mimeType>{e.g. image/jpeg}</mimeType>
</asset>
<asset>
<Id>{internal Propertybase InventoryAsset Id}</Id>
<category>{Images, Videos or Documents}</category>
<isExternalLink>true</isExternalLink>
<title>{title}</title>
<url>{full url to image/video/document}</url>
<tags>{comma separated tags}</tags>
</asset>
<asset>
{...}
</asset>
{more assets ...}
</item>
<item>
{...}
</item>
{more items ...}
</itemList>
</searchResult>
那麼我有上面的XML,我需要將項目標記與其子節點一起存儲在數據庫表中作爲屬性,並且必須將資產標記及其子節點存儲在具有項目標識的另一個表中作爲項目表的外鍵,我該如何做很多工作,但無法獲得它的工作方式如何使用C#在SQL Server 2008 R2中拆分和存儲XML?
'而(reader.Read()){ 如果 (reader.NodeType == XmlNodeType.Element) { reader.Read(); Response.Write(reader.Value +「」); } }' 我只能說到這一點。沒有一個想法如何進一步進行 – 2012-02-04 14:09:35
您是否嘗試使用'XDocument'而不是'XmlReader'? – Oded 2012-02-04 14:10:23
是的,我試過,但也不明白,以及 – 2012-02-04 14:11:44