Solved

C# and MySQL - Storing a picture file into database

Posted on 2007-04-11
4
1,339 Views
Last Modified: 2007-12-19
Hi guys 'n gals,

How would I go about saving a JPG picture into a MySQL Database, with C#? I know how to connect to the database, but I have no idea what I would go about converting the picture into data, which I can store into the database, let alone, reading it back out.


Any ideas?

Cheers!
0
Comment
Question by:Cyber-Drugs
4 Comments
 
LVL 11

Accepted Solution

by:
f_o_o_k_y earned 300 total points
ID: 18889581
This might be helpful.
Its used with asp page and MSDE but it should be very similar
instead image data type in MYSQL use BLOB.
http://www.aspfree.com/c/a/ASP.NET/Uploading-Images-to-a-Database--C---Part-I/
http://www.aspfree.com/c/a/ASP.NET/Retrieving-Images-from-a-Database--C---Part-II/

Best Regards
FooKy
0
 

Expert Comment

by:emrahtufan
ID: 18891686
I dont know the exact needs of the application but I think, instead of inserting an image to the database, upploading it to the some server location and saving the path in the database is better.

Regards

emrah

0
 
LVL 3

Assisted Solution

by:zajda82
zajda82 earned 200 total points
ID: 18892271
here you have an example of storing images in MySql

http://www.codeproject.com/aspnet/image_asp.asp

0
 
LVL 4

Author Comment

by:Cyber-Drugs
ID: 18904310
Thanks f_o_o_k_y and zajda82,

After a bit of tweaking, that did the trick!
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question