xml獲取屬性值的方法

 sSqlstr += string.Format(@" and businessattr.value('(/Arch/Field[@Name=""發文單位$$""])[1]','varchar(50)') like '%{0}%'", Request.QueryString["FaWenDanWei"]);node

 

  private string GetFaWenDanWei(string businessAttrXml)
    {
        string result = string.Empty;
        XmlDocument doc = new XmlDocument();
        doc.LoadXml(businessAttrXml);
        var node = doc.SelectSingleNode("Arch/Field[@Name='發文單位$$']");
        if (node != null)
        {
            result = node.InnerText;
        }
        return result;
    }orm

相關文章
相關標籤/搜索