I'm trying to create a form to edit the datagridview which is data-bind to an access database, but when I was querying the database it threw an exception "Data type mismatch in criteria expression". Here's my code/select query:
OleDbCommand cmd = conn.CreateCommand();
string query = "SELECT * FROM DataServisan WHERE NomorNota=?";
conn.Open();
cmd.CommandText = query;
cmd.Parameters.Add(new OleDbParameter { Value = nomorNota, DbType = DbType.String });
OleDbDataReader dr = cmd.ExecuteReader();