Why empty cell throws an error during SQL stored procedure execution

后端 未结 4 915
再見小時候
再見小時候 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:51

    The stack trace and error message you provided state exactly why it isn't working. It says

    DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'Specialty3'.
    

    which is coming out of

    ...
    System.Web.UI.DataBinder.Eval(Object container, String[] expressionParts) +142
    ...
    

    which means it is erroring where you are doing Eval("Specialty3").

    What all this boils down to is that the data set coming back from your database doesn't contain a column named Specialty3. It could be from a misspelling, from not updating a proc or for a number of other reasons.

提交回复
热议问题