i have 2 text boxes. the problem which i am facing is that when i enter a number in textbox1, the program should fetch the data from database and display the result in textbox2 but with out the use of any button. i have no idea which event to use. here is a code but i guess it is useless:
private void textBox2_Click(object sender, EventArgs e)
{
con.Open();
cmd.Connection = con;
cmd.CommandText = "SELECT item_name FROM prod_info WHERE barcode=" + textBox2.Text + "";
cmd.ExecuteNonQuery();
con.Close();
}