Hi,
I'm a beginer in c sharp and I can't pass over a problem. I would like to bind a blob field (mysql) with a picturebox in c sharp;
here is the code:
what shall I do to extract the picture form database and put it in a picturebox
like I put the other fields in textbox ?
thank you in advance
I'm a beginer in c sharp and I can't pass over a problem. I would like to bind a blob field (mysql) with a picturebox in c sharp;
here is the code:
Code:
string query = "Select name,director,picture from Movies where Movies.name='" + search + "'";
//create command and assign the query and connection from the constructor
MySqlCommand cmd = new MySqlCommand(query, connection);
//Execute command
MySqlDataReader dr;
dr = cmd.ExecuteReader();
if (dr.HasRows)
{
while (dr.Read())
{
txtname.Text = (dr["Name"] + "");
txtdirector.Text = (dr["Director"] + "");
txtactors.Text = (dr["Actors"] + " "");
}
}
else
MessageBox.Show("The movie is unavailable");
what shall I do to extract the picture form database and put it in a picturebox
like I put the other fields in textbox ?
thank you in advance
Comment