Can someone help me??
How to retrive image from MySQL(not MS_SQL) and show into my <asp:Image> control using c#
Lets said my table on have a field as following:
"SELECT pic FROM image"
Thanks in advance !!
Can someone help me??
How to retrive image from MySQL(not MS_SQL) and show into my <asp:Image> control using c#
Lets said my table on have a field as following:
"SELECT pic FROM image"
Thanks in advance !!
I have the problem too. I searched but not found any solution. plz guid me
(^_^)
You should save the image path in the table. Then retrieve from it.
get Byte Array from DB then convert it into image and save it into some folder on serverside then use the URL of that image to represent it
eg:-
imageSample.imageURL=~URLofYourImage;
CODE:-
public void byteArrayToImage(byte[] byteArrayIn)
{
try
{
MemoryStream ms = new MemoryStream(byteArrayIn);
System.Drawing.Image imgPhoto = System.Drawing.Image.FromStream(ms);
imgPhoto.Save(Server.MapPath("temp.jpg"));
imgEmployee.ImageUrl = "~/Employee/temp.jpg";
}
catch (Exception ex)
{
imgEmployee.ImageUrl = "~/Admin/emp1.jpg";
ExceptionLogger.PublishError(ex);
}
}
Please do not resurrect old threads. If you have any questions please ask. .... You are welcome to start your own threads.
Please read the rules before posting again - http://www.daniweb.com/forums/thread78223.html and rules.
Thread Closed.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.