ArgumentNullException was unhandled
<p>This is a part of a code that will saved image to database</p>

<pre><code>Bitmap TempImage = new Bitmap(@cwd + "\\Final.jpg", true);
        pictureBox.Image = new Bitmap(TempImage);//pictureBox.Image = Image.FromFile(imgName[0]);
        TempImage.Dispose();
        string name = textBox1.Text + ".jpg";
        MemoryStream mstr = new MemoryStream();
        pictureBox.Image.Save(mstr, pictureBox.Image.RawFormat);
        byte[] arrImage = mstr.GetBuffer();
</code></pre>

<p>then the program halts at <code>pictureBox.Image.Save(mstr, pictureBox.Image.RawFormat);</code> saying <code>ArgumentNullException was unhandled, Value cannot be null.
Parameter name: encoder</code></p>

<p>what would be wrong?</p>
