Guest User

Untitled

a guest
Feb 5th, 2018
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. MySqlConnection con = new MySqlConnection("server=localhost;database=star;uid=root;password=;");
  2. con.Open();
  3. MySqlCommand com = new MySqlCommand("select * from dt where USERNAME='" + textBox1.Text + "'", con);
  4. MySqlDataReader dr = com.ExecuteReader();
  5. dr.Read();
  6. Byte[] img = new Byte[0];
  7. img = (Byte[])dr[1];
  8. MemoryStream ms = new MemoryStream(img);
  9. //img.Save(ms,ImageFormat.Jpeg);
  10. pictureBox1.Image = Image.FromStream(ms);
  11. dr.Close();
  12.  
  13.  
  14.  
  15. }
Add Comment
Please, Sign In to add comment