I have redImage and whiteImage in my database table colourGame. Their datatype is image. And also, binary image. I want to display them in a gridview.
SqlDataAdapter da= new SqlDataAdapter("SELECT
ballID,
gameLevel,
gameChapter,
redImage,
whiteImage
from
colourGame
WHERE
gameLevel = '"+ ddlLevel.Text+"'
AND gameChapter = '"+ddlChapter.Text+"' ", cn);
ddlLevel and ddlChapter are dropdownlist.
ddlLevel.Items.Add("3");
ddlLevel.Items.Add("4");
ddlChapter.Items.Add("1");
ddlChapter.Items.Add("2");
ddlChapter.Items.Add("3");
ddlChapter.Items.Add("4");
ddlChapter.Items.Add("5");
In my database table data, if redImage have image, whiteImage will be NULL and vice versa.
Therefore I experienced an error regarding null value.