static public string CreatePlaylist(int userId, string playlistName, int playlistImgId)
{
DataTable playlistTable = Dal.CreatePlaylist(userId, playlistName, playlistImgId);
Playlist p = new Playlist((int)playlistTable.Rows[0]["UserID"]);
p.PlaylistName = playlistTable.Rows[0]["Playlist_Name"] == DBNull.Value ? null : (string)playlistTable.Rows[0]["Playlist_Name"];
p.PlaylistImg = playlistTable.Rows[0]["Playlist_Img_ID"] == DBNull.Value ? null : (int)playlistTable.Rows[0]["Playlist_img_ID"];
return new JavaScriptSerializer().Serialize(p);
}
I get this error :
Type of conditional expression cannot be determined because there is no implicit conversion between 'int' and <null>
I found similar questions as this but didn't understand their solution.