• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1349
  • Last Modified:

C# and MySQL - Storing a picture file into database

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
Cyber-Drugs
Asked:
Cyber-Drugs
2 Solutions
 
f_o_o_k_yCommented:
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
 
emrahtufanCommented:
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
 
zajda82Commented:
here you have an example of storing images in MySql

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

0
 
Cyber-DrugsAuthor Commented:
Thanks f_o_o_k_y and zajda82,

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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now