title: C# search form with database
body: <p>I have a registeration form for new students and I need to have a datagridview with a textbox and a button above the datagridview to search students by studentID.I tried this code, but it didn`t work</p>
  
  <pre><code> private void txtsearch_Click(object sender, EventArgs e)
      {
          SqlConnection conn = new SqlConnection();
          DataTable dt = new DataTable();
          SqlDataAdapter SDA = new SqlDataAdapter();
          SDA.Fill(dt);
          dataGridView1.DataSource = dt;
  
      } 
  </code></pre>