Someone can help me, what happens is that I would like to fill label
with data from a query in sql, the query returns only one result but I can not show it in label
this is my code in c #:
conexion.Open();
SqlCommand cmd2 = conexion.CreateCommand();
cmd2.Parameters.AddWithValue("@codigo1", txtcod.Text);
cmd2.CommandType = CommandType.Text;
cmd2.CommandText = "select PROD_NOMBRE as Producto from dbo.CAT_PRODUCTOS where PROD_COD1 = @codigo1 ";
cmd2.ExecuteNonQuery();
DataTable dt2 = new DataTable();
SqlDataAdapter da2 = new SqlDataAdapter(cmd2);
da2.Fill(dt2);
label1.Text = dt2.ToString();
conexion.Close();