Hi i am new to windows form programming and having some trouble coding.
What i am trying to do is replace the current background of the windows form with another background that has been stored in my database.
cmd = new SqlCommand("select Background from Employee where EmployeeName='" + label2.Text + "'", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
if (ds.Tables[0].Rows.Count > 0)
{
MemoryStream ms = new MemoryStream((byte[])ds.Tables[0].Rows[0]["Background"]);
pictureBox1.Image = new Bitmap(ms);
These are the codes that I tried using a picturebox as the background, But unable to do so with the background. Any form of help is much appreciated