C# store the picturebox image to a database
<p>I have a Picture box.The image in the picture box is a static one.I am loading the image from the resources folder.I am not able to read the static image from the picture box and store it in the database.This is my code.</p>

<pre><code> private void btnOk_Click(object sender, EventArgs e)
    {
        Image votingBackgroundImage = pictureBox5.Image;
        Bitmap votingBackgroundBitmap = new Bitmap(votingBackgroundImage);
         Image votingImage = (Image)votingBackgroundBitmap;
            var maxheight = (votingImage.Height * 3) + 2;
            var maxwidth = votingImage.Width * 2;
            if (maxheight == 227 &amp;&amp; maxwidth == 720)
            {

                 System.IO.MemoryStream defaultImageStream = new System.IO.MemoryStream();
                 Bitmap NewImage =new Bitmap(votingImage,new Size(720,227));
                 Image b = (Image)NewImage;
                  b.Save(defaultImageStream, System.Drawing.Imaging.ImageFormat.Bmp);
                 defaultImageData = new byte[defaultImageStream.Length];
              }
    }
</code></pre>

<p>Query I used to  add the image in the database:</p>

<pre><code>            String MyString1=string.format("insert into question_table(background_image) Values(@background_image)");
            com = new SqlCommand(MyString1, myConnection);
              com.Parameters.Add("@background_image", SqlDbType.Image).Value = defaultImageData;
                com.ExecuteNonQuery();
</code></pre>

<p>When I check this in the sql database.It store the value as 0 x000000...</p>
