I want to display every thing in database to asp.net. But some of my value are null and some not. When I load to the page that null it will cause error. May I know how can I fix this problem? My mean is to display everything from database doesn't care it is NULL or having content.
SELECT m.PersonID, m.Picture,m.PersonName, t.title, t.Fileupload, t.contentBody, t.dateInserted FROM person m, thread t WHERE m.PersonID = t.PersonID AND t.threadID = @TID
The t.FileUpload in my database some of row are null and some contain contain. And the error is
system.invalidcastexception unable to cast object of type 'system.dbnull' to type 'system.string'