Solved

C# and MySQL - Storing a picture file into database

Posted on 2007-04-11
4
1,340 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying 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

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
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…

726 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