I’ve got an SQL Server database, which has a table containing a number of fields – one of which is called ‘Image’, of type varbinary(MAX). There is no ‘ImageID’ field, and thus I presume I am unable to use an ashx page to be able to display the image in an asp:Image control (as explained in numerous guides).
What approach should I take for displaying the image? I have to use a blob by force, and cannot add an ‘ImageID’ field, due to strict requirements.
Any ideas?
Don’t know and haven’t seen the guides you are talking about, but I’m making a guess, that those samples pass ImageID to ashx and then retrieve BLOB from database by using this ImageID as criteria in SQL statement.
So you can do something similar, just by using some other identifier instead of ImageID like, RecordId or something other you have in your table. Just make sure, that this column is unique identifier for given row.
Probably you just need to use primary key column of this table.