Avatar of rito1
rito1
 asked on

Date Parameter - System.Data.OleDb.OleDbException: Data type mismatch in criteria expression.

Hi All,

I am working on an ASP.NET website which uses MS Access as a database.

I am trying to pass a date parameter into an Access query but get the following error when executing the OleDbCommand:

System.Data.OleDb.OleDbException: Data type mismatch in criteria expression.

I have double checked that my parameter is formatted as a date using the DateTime data type within ASP.NET.

Is there something else I should know about MS Access date formats which could be causing this issue?

Thanks,

Rit
C#ASP.NET.NET Programming

Avatar of undefined
Last Comment
rito1

8/22/2022 - Mon
SOLUTION
kaufmed

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
Imran Javed Zia

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
nekkantisurendra

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
rito1

ASKER
I got sorted... I needed to use the DateTime.ToOADate Method for MNS Access.

thanks,

Rich
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck