I have a pictures table that has the following columns:
PICTURE_ID int IDENTITY(1000,1) NOT NULL,
CATEGORY_ID int NOT NULL,
IMGDATA image NOT NULL,
CAPTION1 text COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
MIME_TYPE nchar(20) NOT NULL DEFAULT ('image/jpeg'),
IMGTHDATA image NOT NULL
In my code-behind I have this:
string tableName = "CATPICS";
SqlConnection dbConnection = new SqlConnection(connStr);
SqlDataAdapter daCatPics = new SqlDataAdapter("SELECT TOP(3) * FROM CATEGORY_PICTURES", dbConnection);
DataSet dsPics = new DataSet();
daCatPics.Fill(dsPics, tableName);
gvCatPics.DataSource = dsPics;
gvCatPics.DataMember = tableName;
gvCatPics.DataBind();
On the markup I pretty much have:
<asp:GridView ID="gvCatPics" runat="server"></asp:GridView>
However when the code executes, it simply ignores the two image columns (IMGDATA and IMGTHDATA). For some reason it doesn't recognize that they are image columns. Does anyone know of the simplest way of having it render the image?