Last post Aug 02, 2014 11:44 PM by oned_gk
Aug 02, 2014 07:12 PM|EasyHero|LINK
i use C#. and also, how do i get an image to be downloaded from mysql database at runtime upon request. here is a bit of my declaration code and conditional construct code
byte  f = (byte)(read["Passport"]); // this reads d byte data from the column passport in the database and assigns it to byte f.
if (f == null)
admin1pass.ImageUrl = null;
MemoryStream ms = new MemoryStream(f); // this holds the image gotten from the database
admin1pass.ImageUrl = System.Drawing.Image.FromStream(ms);
'now thats where i'm stuck. i hv used the
namespaces but none contains the class Image which is oftren what i use in windows form apps.
Aug 02, 2014 07:51 PM|A2H|LINK
namespaces but none contains the class Image
Image class is a part of System.Drawing
Namespace. Have you added the reference of Drawing dll in your project.
Please follow the below steps to refer the assembly in your project
Aug 02, 2014 11:44 PM|oned_gk|LINK
admin1pass.ImageUrl = "getimage.ashx?id=1000";
create getimage.ashx to get image from db, then you can pass id query string to get spesific image