title: How to insert image from image control into WPF to SQL Database using entity data model
body: <p>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</p>
  
  <p>i made event to upload image into image control and now i need to save it to sql database using entity framework</p>
  
  <p>image load button code :</p>
  
  <pre><code>private void uploadbt_Click(object sender, RoutedEventArgs e)
   {
       OpenFileDialog op = new OpenFileDialog();
       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 = new BitmapImage(new Uri(op.FileName));
       }  
   }
  </code></pre>
  
  <p>this is my database named cv</p>
  
  <p><img src="https://i.stack.imgur.com/80zU5.png" alt="enter image description here"></p>
  
  <p>this is my code to save some information into database this cose for save button</p>
  
  <pre><code>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();
  </code></pre>
  
  <p>how can i save image from image control into database ?</p>
  
  <p>thanks;</p>