i have a windows forms application and using sqlite to connect to a database, im trying to display the contents of a table in a datagridview, it works if i dont use parameters but if i set up parameters then i get the error message
using (SQLiteCommand cmd = conn.CreateCommand())
{
try
{
cmd.CommandText = @"SELECT * FROM customer WHERE lastname = @LastName";
cmd.Parameters.Add("LastName", DbType.String).Value = txt_name.Text;
da_Customer = new SQLiteDataAdapter(cmd.CommandText, conn);
dt_Customer = new DataTable();
da_Customer.Fill(dt_Customer);
dgv_customer.DataSource = dt_Customer;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}