I have binary data of an image in MySQL database, and I want to display it in an image in ASP.NET or an image in HTML..
I am able to upload image I couldn’t understand how to convert it to Bitmap format
protected void Button2_Click(object sender, EventArgs e)
{
cmd = new OdbcCommand(“SELECT picture from profile limit 1”, MyConnection);
MyConnection.Open();
OdbcDataReader dr = cmd.ExecuteReader();
if (dr.HasRows == false)
{
Response.Write(“No rows”);
}
if(dr.Read())
{
// WHAT TO CODE HERE?
}
}
Can anyone help me to solve this problem?