从SQL Server数据库中检索XML内容

时间:2013-05-18 13:30:22

标签: c# sql-server xml

我已经生成了一个XML,我想用它来查询SQL Server数据库。

<?xml version=\"1.0\" encoding=\"utf-16\"?>
<bank>
  <account>
    <ID>90898908877454</ID>
    <FirstName>Jonathan</FirstName>
    <LastName>Li</LastName>
  </account>
</bank>

C#方法:

public List<BankAccount> bankInf(string content)
{
    List<BankAccount> list = new List<BankAccount>();
    // I want to take the XML content and use it to get all account transaction of the user (using his `ID`, `FirstName` and `LastName` fields)

    return list;// Return a XML of the result
}

我的数据库看起来像

bank
_____

ID   ----- 54857485
FirstName ------ Jonathan
LastName --------Li
Balance --------435.54

0 个答案:

没有答案