2020年12月21日星期一

Parameter is not valid when i retrieve Image

string nama = dgGambar1.Rows[e.RowIndex].Cells["nama_gambar"].FormattedValue.ToString();  btnTambahDataBarang.Enabled = false;  koneksi.Open();  MySqlCommand command = new MySqlCommand("SELECT * FROM and_bwi_gambar WHERE nama_gambar = '" + nama + "'", koneksi);  MySqlDataReader rd;  rd = command.ExecuteReader();  while (rd.Read())  {    txtGambar1.Text = rd.GetValue(2).ToString();    byte[] img = (byte[])rd.GetValue(3);    MemoryStream ms = new MemoryStream(img);    pbGambar1.Image = Image.FromStream(ms);  }  koneksi.Close();  

when i retrieve an image whose size is more than 250kb, it always get an error 'parameter argument invalid'

https://stackoverflow.com/questions/65402583/parameter-is-not-valid-when-i-retrieve-image December 22, 2020 at 10:36AM

没有评论:

发表评论