Hi,
I don't know why I get this exception
Data type mismatch in criteria expression.Microsoft Access Database Engine
once I've added this part
(@cat=0 or ent_id=@cat)
to the conditions below
ent_id is a Number column in the table. If I've removed the part, then it is fine.
I don't know why I get this exception
Data type mismatch in criteria expression.Microsoft Access Database Engine
once I've added this part
(@cat=0 or ent_id=@cat)
to the conditions below
cmd = new OleDbCommand("SELECT ite_abbr & ' ' & ite_name as row1 FROM ite_master where (@cat=0 or ent_id=@cat) and (@int='False' or @int='True' and ite_id in(select ite_id from ite_tab where int_id>11 and int_id in(select int_id from ite_master a,ite_tab b where a.ite_id=b.ite_id and ite_abbr=@abbr))) and ite_id not in(select ite_id from ite_master where ite_abbr=@abbr) order by 1", conn); if (ent_cat_ddl.SelectedIndex > 0) cmd.Parameters.Add("@cat", OleDbType.Decimal).Value = Convert.ToDecimal(ent_cat_ddl.SelectedValue); else cmd.Parameters.Add("@cat", OleDbType.Decimal).Value = 0; ... reader = cmd.ExecuteReader();
ent_id is a Number column in the table. If I've removed the part, then it is fine.
Many Thanks & Best Regards, Hua Min