Tech
Forums
Jobs
Books
Events
Live
Interviews
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
1
Reply
Converting to byte from picturebox
mike Delvotti
Dec 7 2013 8:26 AM
870
Reply
Guys, I'm trying to save the image that was entered into my picturebox via open file dialog, but I get the below exception thrown?
'Object reference not set to an instance of an object.'
Below is my save code to save it back to the DB but clearly something is wrong or I'm not converting to byte array correctly?
MemoryStream stream = new MemoryStream();
logoPictureBox.Image.Save(stream, System.Drawing.Imaging.ImageFormat.Jpeg);
byte[] pic = stream.ToArray();
this.Validate();
this.companyBindingSource.EndEdit();
this.tableAdapterManager.UpdateAll(this.companyDetailsDataSet);
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
how to genrate bar code in C#
Not able to call method