Solved

C# and MySQL - Storing a picture file into database

Posted on 2007-04-11
4
1,336 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

As a database administrator, you may need to audit your table(s) to determine whether the data types are optimal for your real-world data needs.  This Article is intended to be a resource for such a task. Preface The other day, I was involved …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

707 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now