I am trying to load a saved image into MySQL, however still unsuccessful. With the code below I can display all the other fields. Every time I try to add some method to display the image, an error occurs that does not display any search information.
MySqlConnection conn = new MySqlConnection("Server=localhost;Database=portaria;Uid=root;Pwd=''");
conn.Open();
//Inserindo um comando para acessar o funcionário cadastrado
MySqlCommand consultar = new MySqlCommand(
"SELECT funcID, funcRG, funcNome, funcEmpresa, funcSetor, funcRamal, funcFoto, funcStatus " +
"FROM funcionario WHERE funcRG = ?", conn);
consultar.Parameters.Clear();
consultar.Parameters.Add("@funcRG",MySqlDbType.VarChar, 12).Value = txtRG.Text;
consultar.CommandType = CommandType.Text;
//Recebendo o conteúdo da pesquisa
MySqlDataReader info;
info = consultar.ExecuteReader();
info.Read();
//Passando as informações para os campos
lblNumID.Text = info.GetString(0);
txtNome.Text = info.GetString(2);
txtEmpresa.Text = info.GetString(3);
txtSetor.Text = info.GetString(4);
txtFone.Text = info.GetString(5);
//pictureCadastro.Text = info.GetString(6); ------>>>>> Falta carregar a imagem
cBoxStatus.Text = info.GetString(7);
conn.Close();
Can anyone help me?