How do I give a select in a data from my column a table and show it in a label?
EX:
id = 10 -> Banana
Select * From tabela where id = 10
label.Text = Banana
MySqlConnection conexao = new MySqlConnection();
conexao.ConnectionString = ("server=localhost; user id=root; pwd=root ;database=semi");
conexao.Open();
MySqlCommand command = new MySqlCommand();
command.Connection = conexao;
command.CommandText = "Select Valor_Venda from produtos where Codigo = '" + comboBox4.Text + "'";
MySqlDataReader dr = command.ExecuteReader();
DataTable dt = new DataTable();
dt.Load(dr);
label20.Text = dr;
I found an example on the internet and tried to adapt more believe that I'm not on the right path. Can you help me? Any doubt on my question comment that I reply.