Hi, Guys
i am creating an app to save student information into SQL , I want to know how to insert image from image control in WPF using entity framework to SQL database
i made event to upload image into image control and now i need to save it to sql database using entity framework
privatevoid uploadbt_Click(object sender,RoutedEventArgs e){OpenFileDialog op =newOpenFileDialog();
op.Title="Select a picture";
op.Filter="All supported graphics|*.jpg;*.jpeg;*.png|"+"JPEG (*.jpg;*.jpeg)|*.jpg;*.jpeg|"+"Portable Network Graphic (*.png)|*.png";if(op.ShowDialog()==true){
photo.Source=newBitmapImage(newUri(op.FileName));}}
this is my database named cv
Image may be NSFW.
Clik here to view.
this is my code to save some information into database this cose for save button
facultymakerEntities1 entity = new facultymakerEntities1(); cv CV = new cv(); CV.Full_Name = fullnametb.Text; CV.Activities = activitestb.Text; CV.Address = addresstb.Text; CV.Birth_Day = bddate.SelectedDate.Value; CV.Courses = cousetb.Text; CV.E_Mail = emailtb.Text; entity.cvs.Add(CV); entity.SaveChanges();how can i save image from image control into database ?
thanks;
Mohamed Safwat Software Developer