Data is Null. This method or property cannot be called on Null values

后端 未结 7 1161
伪装坚强ぢ
伪装坚强ぢ 2021-02-06 20:07

I\'m working on an application where one can get information on movies from a database as well as add, update and delete the movies. In the database I have three tables (Movie,

7条回答
  •  甜味超标
    2021-02-06 20:47

    Edit your select statement as follows to handle null issue.

    SELECT ISNULL(m.MovieID,0) AS MovieID, 
           ISNULL(g.GenreID,0) AS GenreID, 
           ISNULL(mg.MovieGenreID,0) AS MovieGenreID,
           ISNULL(g.Genre,'') AS Genre
    FROM --rest of your query...
    

提交回复
热议问题