"Paramétre non valid" (not a valid parameter)
Expand|Select|Wrap|Line Numbers
- int bufferSize = 1000;
- try
- {
- string SQL = "Select image from user ";
- MySqlCommand cmd = new MySqlCommand(SQL, db.Connection);
- MySqlDataAdapter da = new MySqlDataAdapter(cmd);
- DataSet ds = new DataSet();
- da.Fill(ds, "image");
- int c = ds.Tables["image"].Rows.Count;
- db.CloseConnection();
- if (c > 0)
- {
- Byte[] byteBLOBData = new Byte[bufferSize];
- byteBLOBData = (Byte[])(ds.Tables["image"].Rows[c - 1]["image"]);
- MemoryStream stmBLOBData = new MemoryStream(byteBLOBData);
- pictureBox1.Image = Image.FromStream(stmBLOBData);
- MessageBox.Show("bien chargée");
- }
- }
- catch (Exception ex)
- {
- MessageBox.Show("Connection Error!\n" + ex.Message, "Error Message",
- MessageBoxButtons.OK, MessageBoxIcon.Error);
- }