Why empty cell throws an error during SQL stored procedure execution

后端 未结 4 863
再見小時候
再見小時候 2021-01-28 01:50
SELECT
    CAST ([content_html] AS XML).query(\'/root/Physicians/specialty/a\') AS [Specialty1]
    , CAST ([content_html] AS XML).query(\'/root/Physicians/specialty2/a\         


        
4条回答
  •  迷失自我
    2021-01-28 02:46

    In case your problem is caused by NULL values, then you can solve your problem with sth like:

    public string DisplayMultipleValues(object strValue)
    {
       if (strValue == null)
          return "";
       else
          return (NonBlankValueOf(strValue.ToString()));
    }
    

    Your Eval statements should look like this:

    <%# Eval("Specialty1") == null ? "" : Eval("Specialty1").ToString() + 
        DisplayMultipleValues(Eval("Specialty2")) + etc ...
    

提交回复
热议问题