How to display .jpg from Database on webpage
Posted on 2011-10-17
The Sql table contains a User row having a 'Logo' column representing a .jpg file.
The logo column has a datatype of varbinary(MAX).
My webpage references the picture with: <asp:Image ID="imgLogo" runat="server" ImageUrl="CompanyLogo" />
That's where I'm stuck.
The User's Profile is an object called 'myProfile', thus the image can be referred to as myProfile.Logo
In the Page_Load event I need to set the variable CompanyLogo to myProfile.Logo
My overall question is how do I set the CompanyLogo variable to the varbinary(MAX) SQL column's contents.
I'm using Linq to Sql and Database I/O is performed in another tier, so at the time in question, the information is available,
I just don't understand how to implement it.