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
JomarMark Tamargo
NA
27
9.7k
PictureBox imageBackground
Jan 14 2016 2:24 AM
1. Question: i like to save this
image background
(see on photo inserted)
in my database if there is no upload photo in picture box. how i can do that? the because i am getting this catch message
Object reference not set to an instance of an object
//Converting Image
public string ImageToBase64(Image image, System.Drawing.Imaging.ImageFormat format)
{
using (MemoryStream ms = new MemoryStream())
{
// Convert Image to byte[]
image.Save(ms, format);
byte[] imageBytes = ms.ToArray();
// Convert byte[] to Base64 String
string base64String = Convert.ToBase64String(imageBytes);
return base64String;
}
}
// Inserting Image to database
cmd.Parameters.Add("@Image", SqlDbType.VarChar).Value = Convert.ToString(ImageToBase64(pbPicture.Image, System.Drawing.Imaging.ImageFormat.Jpeg));
Reply
Answers (
2
)
how to send an email to outlook to approve, reject, onhold
when marker move how to show latlong in ASP.net MVC?