Criteria Expression in vb.net

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to create a parameterized query and it keeps giving me an error "Datatype error in expression" when I enter = @ChildID or =?ChildID. The ? is supposed to be the wildcard for Access SQL.

I am using an Access database that uses an autonumber field as the primary key for a table. The data adapter on the data tier is based on a table called tblChild. The field is ChildID. I'm trying to enter it in the CommandText property of the SelectCommand.

I tried entering info in the criteria for another integer autonumber field and had the same error message.

It appears to work ok in the string fields though.

Is this a problem with autonumber fields in Access being used in VB.net?
Does anyone have any suggestions at all??? If there's a knowledge base
article, please point me to it. I have been unable to find anything.

Thanks!
 
Hi Cor,

I figured it out. I only needed to use ?, rather than include the field name too.
Thanks for tips.

Have a good day.
 
Back
Top