title: How to use SQL parameters with NpgsqlDataAdapter?
body: <p>Is it possible to use parameters together with NpgsqlDataAdapter, as I can do with NpgsqlCommand:</p>
  
  <pre><code>          string sql = "SELECT * FROM tbl_student WHERE name = @val";
            NpgsqlCommand command = new NpgsqlCommand(sql, conn); 
            command.Parameters.AddWithValue("@val", name);
  </code></pre>
  
  <p>I have this code, which displays the information about the students i a gridview:</p>
  
  <pre><code>            string sql = "SELECT * FROM tbl_student WHERE studentname = '" + name + "'";               
              DataSet ds = new DataSet();
              DataTable dt = new DataTable();
              NpgsqlDataAdapter da = new NpgsqlDataAdapter(sql, conn);    
              ds.Reset(); 
              da.Fill(ds);   // filling DataSet with result from NpgsqlDataAdapter
              dt = ds.Tables[0]; // select select first column
              GridView1.DataSource = dt;   //connect grid to DataTable           
              GridView1.DataBind();
  </code></pre>
  
  <p>My question is: can I somehow use parameters (as in the example above) instead of using '" + name + "' in the SQL?
  I have learned always to use parameters, is it also necessary when using NpgsqlDataAdapter?</p>
  
  <p>Thank you.</p>