TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
mansoor altaf
NA
68
0
How to save and retrive image from/to picture box
Oct 1 2011 4:14 AM
hi.
i have selected the image using openfiledialog and loaded it to the picturebox in c# desktop app.
now i want to save the image, while saving the image it raises the exception that [] , these brackets are invalid parameters.
my code is.
MemoryStream stream=new MemoryStream();
pictureBox1.Image.Save(stream,System.Drawing.Imaging.ImageFormat.Jpeg);
pic=stream.ToArray();
here pic is of byte[] type. which is class level variable.
then i store pic in insert query like this.
string str = "insert into branches (branchcode,branchname,address,landlinecell,picture,description) values(" + branchcode + ",'" + branchname + "','" + address + "','" + landline + "'," + @pic+ ",'" + description + "')";
and then send the query to my save method to do the insertion operation.
what is the problem??
Reply
Answers (
8
)
DataGridView with multiple tables[Show/Insert/Update/Delete]
Control is visible but not loaded (winAPI Programming)