title: Passing parameter in select statement in postgresql
body: <p>I am trying to pass parameter for below select statement in postgresql, but it is not returning any row, </p>
  
  <pre><code>cmd.Parameters.AddWithValue("@name", richTextBox_searchEmp.Text);                
  string sql = "select * from tbl_emp_Info where LOWER(firstname) like LOWER('@name%');";
  </code></pre>
  
  <p>where- richTextBox_searchEmp.Text is “first”
  have also tried -</p>
  
  <pre><code>cmd.Parameters.AddWithValue("@name", NpgsqlDbType.Char , searchEmp.Text);
  </code></pre>
  
  <p>while, parameter less query below always returning correct results. </p>
  
  <pre><code> string sql = "select * from tbl_emp_Info where LOWER(firstname) like LOWER('first%');";
  </code></pre>
  
  <p>Please help!!!</p>
  
  <p>Complete Code-   </p>
  
  <pre><code>            conn.Open();
              cmd.Parameters.AddWithValue("@name", NpgsqlDbType.Char , richTextBox_searchEmp.Text);
  
              string sql = "select * from tbl_emp_Info where LOWER(firstname) like LOWER('@name%');";
  
              NpgsqlDataAdapter da = new NpgsqlDataAdapter(sql, conn);
  
              cmd.Connection = conn;
              cmd.CommandText = sql;
              cmd.ExecuteNonQuery();
  
              ds.Reset();
              da.Fill(ds);
              dt = ds.Tables[0];
              dataGridView.DataSource = dt;
  </code></pre>