private void button3_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=C:\rishabhc\imagedatabase\Database1.mdf;Integrated Security=True");
con.Open();
SqlDataReader dr;
SqlCommand cmd = new SqlCommand("select Id,Image from test where Id='"+textBox2.Text+"'", con);
dr = cmd.ExecuteReader();
if (dr.Read())
{
byte[] imgg = (byte[])(dr[1]);
if (imgg == null)
pictureBox2.Image = null;
else
{
MemoryStream m = new MemoryStream(imgg);
pictureBox2.Image = Image.FromStream(m); <-----------------------------ERROR ( " PARAMETER IS NOT VALID " )
}
}
con.Close();
}
------------------------------------------
Why Is It Giving This Error?????
Please Help,I am New To Programming.
Go to the complete details ...