By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,665 Members | 1,927 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,665 IT Pros & Developers. It's quick & easy.

Problem updating an access db with ASP.NET

P: n/a
I'm having a problem updating recordsin an Access DB table. I can update
other tables in this db with no problem, and I can dreate new record in all
of the tables (including this one.)> But I can't seem to update it. I keep
getting this error:

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

from this line:

rowsAffected = dbCommand.ExecuteNonQuery

I know that the above line actully does the updating , and the error is
actually somewhere else.
But I can't find it. I've checked and rechecked the data types I'm trying to
update in my code (the data is pulled from the table I'm having trouble
updating, so I don't think that is the problem.) And I've tried Webmatrix's
db wizard to generate the code as well as doing it myself, no change.
I know I can't be given a specific answer with out posting the code, I just
need to know what exactly the error message means, and where to start
looking for errors.

Is it:
bad code? bad data typing (IE an integer as a string for example)?
an error in the data? (even though it just was pulled from the db seconds
before)
an errror in the db table?
or trying to update data in the db that is for ex: an long value with a
string?

Although I've tried changing around the data I'm trying to update by
removing each one of the data objects (fields) I'm trying to update from my
code, still no change.

Any direction would be greatly appreciated!

Thanks.
Mark
Nov 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
The error message means that there is a data type mismatch in the command
you're executing, which would be a SQL command. The SQL language uses
punctuation to indicate data types. I would guess offhand that you used the
wrong punctuation.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Mark" <py*******@hotmail.com> wrote in message
news:eU**************@tk2msftngp13.phx.gbl...
I'm having a problem updating recordsin an Access DB table. I can update
other tables in this db with no problem, and I can dreate new record in all of the tables (including this one.)> But I can't seem to update it. I keep
getting this error:

System.Data.OleDb.OleDbException: Data type mismatch in criteria expression
from this line:

rowsAffected = dbCommand.ExecuteNonQuery

I know that the above line actully does the updating , and the error is
actually somewhere else.
But I can't find it. I've checked and rechecked the data types I'm trying to update in my code (the data is pulled from the table I'm having trouble
updating, so I don't think that is the problem.) And I've tried Webmatrix's db wizard to generate the code as well as doing it myself, no change.
I know I can't be given a specific answer with out posting the code, I just need to know what exactly the error message means, and where to start
looking for errors.

Is it:
bad code? bad data typing (IE an integer as a string for example)?
an error in the data? (even though it just was pulled from the db seconds
before)
an errror in the db table?
or trying to update data in the db that is for ex: an long value with a
string?

Although I've tried changing around the data I'm trying to update by
removing each one of the data objects (fields) I'm trying to update from my code, still no change.

Any direction would be greatly appreciated!

Thanks.
Mark

Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.