title: mysql c# search textbox
body: <p>Hi i'n trying to search a product name from database and display i ton my textbox but at same time i need the id from that product to insert it on grid and after on another table.</p>
  <pre><code>MySqlConnection connection = new MySqlConnection(&quot;connectonString&quot;);
  
              string selectQuery = &quot;select descricao,codigo from produtos where (barras = '@barcodes') or(descricao like '%' + @product + '%')&quot;;
              connection.Open();
              MySqlCommand command = new MySqlCommand(selectQuery, connection);
              MySqlDataReader reader = command.ExecuteReader();
              command.Parameters.AddWithValue(&quot;@barras&quot;, Txtcodigo.Text);
              command.Parameters.AddWithValue(&quot;@product&quot;, Txtcodigo.Text);
              //MySqlDataReader reader = command.ExecuteReader();
              DataTable dt2 = new DataTable();
              dt2.Load(reader);
              DataView dvDataTable = new DataView(dt2);
              //DataRow row = dt2.Rows[1];
              Txtproduto.Text = reader.GetString(&quot;descricao&quot;);
  </code></pre>
  <p>It says my reader is empty but, i've used the same code to load combobox and it works, the only difference is that on combobox my select is: select * from unidades; and there re no parameters as there are only 2 rows on that table, and on products table there are more and i only need those 2: description and id; barcodes is just to search</p>