title: Unable to retrieve image from database to picturebox
body: <p>I have a <code>PictureBox</code> control in my Windows Form.<br>Datatype of Picture column is 'image' in table 'TableName'<br>
  These here is the code which says, take the image from database and put it in <code>PictureBox</code> control:</p>
  
  <pre><code>string connectionString = @"Initial Catalog=DataBaseName;Data Source=DataSourceName;Integrated Security=SSPI;";
              SqlConnection connection = new SqlConnection(connectionString);
              connection.Open();
              SqlDataAdapter da = new SqlDataAdapter(new SqlCommand("Select Picture From TableName where ID = 2 ", connection));
              DataSet ds = new DataSet();
              da.Fill(ds);
              byte[] myImage = new byte[0];
              myImage = (byte[])ds.Tables[0].Rows[0]["Picture"];
              MemoryStream stream = new MemoryStream(myImage);
              pictureBox1.Image = Image.FromStream(stream);
              connection.Close();
  </code></pre>
  
  <p>Usually it always works but now its showing a <code>ArgumentExeption</code> with error 'Paramerter is not valid' at this line <code>pictureBox1.Image = Image.FromStream(stream);</code><br>
  I don't understand? Which Parameter?<br></p>
  
  <p>Any help will be appreciated. </p>