title: Perform search in 3tier architecture
body: <p>i am all confused in 3 tier 
  without using 3 tier this function worked</p>
  
  <pre><code>DataTable dt; 
  private void textBox1_TextChanged(object sender, EventArgs e)
          {
              DataView dv = new DataView(dt);
              dv.RowFilter = string.Format("emp_f_name LIKE '%{0}%'",textBox1.Text);
              dataGridView1.DataSource = dv;
  
          }
  </code></pre>
  
  <p>BUt in 3 tier 
  i am all confused can u guys help me rewrite the code i am trying to search firstname in a textbox</p>
  
  <p>in my bll class </p>
  
  <pre><code>public DataTable Display(string fname)
          {
              try
              {
  
                  return obj.Display(fname);
              }
              catch (Exception ex)
              {
                  throw ex;
              }
          }
  </code></pre>
  
  <p>in my dal class</p>
  
  <pre><code>  public DataTable Display(string fname)
          {
              string query2;
  
              OpenCnn();
              query2 = "SELECT * FROM cntc_employee where fname='" +fname + "' ";
              sda = new SqlDataAdapter(query2, con);
              dt = new DataTable();
              sda.Fill(dt);
              CloseCnn();
              return dt;
          }
  </code></pre>
  
  <p>in ui class </p>
  
  <pre><code> private void textBox1_TextChanged(object sender, EventArgs e)
          {
              string fname = txtfname.Text;
             DataView dv = new DataView(dt);
            dt = obj.Display(fname);
             dv.RowFilter = string.Format("emp_f_name LIKE '%{0}%'", textBox1.Text);
  
              dataGridView1.DataSource = dv;
              this.dataGridView1.DataSource = obj.Display(this.txtfname.Text);
          }
  </code></pre>