title: searching using enter key on windows application?
body: <p>I am new to c# , i have one <code>TextBox</code> and one <code>gridview</code> when user type something in <code>Textbox</code> to search, the <code>gridview</code> is filled succesfully when clicked on search button.
  But my concern is instaed of search button use ENTER KEY TO search data in gridview.</p>
  
  <pre><code>private void textBox3_TextChanged(object sender, KeyPressEventArgs e1, EventArgs e) 
  {
      if (e1.KeyCode == Keys.Enter) 
      { 
         string sql = "[DocEntry],[JobCardNo],[ITEMNAME],[OD] ,[PlanQty],
                        [FinalInspectionRemarks] ,[OrderDate] ,[Division]
                            WHERE JobCardNo ='" + textBox3.Text.ToString() + "'";  
         SqlDataAdapter da = new SqlDataAdapter(sql, objConn1); DataSet ds = new DataSet(); 
         objConn1.Open(); 
         da.Fill(ds, "ProductionInventoryReport"); 
         dataGridView1.DataSource = ds; //dataGridView1.DataBind();  
         dataGridView1.DataMember = "ProductionInventoryReport"; 
         objConn1.Close(); e1.Handled = true; 
       } 
   } 
  </code></pre>
  
  <p>I have tried this but not working</p>