How to use SQL parameters with NpgsqlDataAdapter?
问题 Is it possible to use parameters together with NpgsqlDataAdapter, as I can do with NpgsqlCommand: string sql = "SELECT * FROM tbl_student WHERE name = @val"; NpgsqlCommand command = new NpgsqlCommand(sql, conn); command.Parameters.AddWithValue("@val", name); I have this code, which displays the information about the students i a gridview: string sql = "SELECT * FROM tbl_student WHERE studentname = '" + name + "'"; DataSet ds = new DataSet(); DataTable dt = new DataTable(); NpgsqlDataAdapter