Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MySqlConnection con = new MySqlConnection("server=localhost;database=star;uid=root;password=;");
- con.Open();
- MySqlCommand com = new MySqlCommand("select * from dt where USERNAME='" + textBox1.Text + "'", con);
- MySqlDataReader dr = com.ExecuteReader();
- dr.Read();
- Byte[] img = new Byte[0];
- img = (Byte[])dr[1];
- MemoryStream ms = new MemoryStream(img);
- //img.Save(ms,ImageFormat.Jpeg);
- pictureBox1.Image = Image.FromStream(ms);
- dr.Close();
- }
Add Comment
Please, Sign In to add comment