Problem updating an access db with ASP.NET

  • Thread starter Thread starter Mark
  • Start date Start date
M

Mark

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
 
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.
 
Back
Top