Why is my SqlCommand returning a string when it should be an int?

前端 未结 9 1399
暗喜
暗喜 2020-12-29 17:06

I have a query that should always be returning a single int. I have now logged it returning a string entirely unrelated to what it should be.

We\'ve been ge

9条回答
  •  灰色年华
    2020-12-29 17:13

    the Field "PkID" is a varchar/char in the "WebSite" Table.

    If the "ISNULL" part of the query is true then it will return an integer (0), else it will return an string with the value of "PkID"

提交回复
热议问题