Adapter.UpdateCommand.ExecuteNonQuery() ???

  • Thread starter Thread starter Darryn Ross
  • Start date Start date
D

Darryn Ross

Hi,

I am having a problem updating a database table in an application of mine.
The application is thrown when i fire the following command...
Adapter.UpdateCommand.ExecuteNonQuery() ;

The exception that is being thrown is the following...

message -> "Data type mismatch in criteria expression"

source ->"Microsoft JET Database engine"

TargetSite-> "Void ExecuteCommandTextErrorHandling(Int32)"

i have no idea why this isn't working, the database field is a text field
and not required and no validating rules accompany it??



Regards

Darryn
 
It sounds like the datatypes of your arugments are mismatched with their
destination columns. Check your argument values again, and explicity cast
them if necessary.

kevin aubuchon
 
i have double and triple checked my update command and database fields and i
can't find a problem...

UpdateDtlsCommand.Parameters.Add("@Param1", OleDbType.VarChar, 50, "Name") ;
UpdateDtlsCommand.Parameters["@Param1"].Value = txtname.text ;

Database field is a "text" field... ??? any more ideas, this is such an easy
thing, i can understand what the problem is?

Regards

Darryn
 
Darryn said:
i have double and triple checked my update command and database fields and
i can't find a problem...

UpdateDtlsCommand.Parameters.Add("@Param1", OleDbType.VarChar, 50, "Name")
; UpdateDtlsCommand.Parameters["@Param1"].Value = txtname.text ;

Database field is a "text" field... ??? any more ideas, this is such an
easy thing, i can understand what the problem is?

You might want to look at the chart at the bottom of this page:

http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=454

It's for sql and c#, but it might help.

As you can see, implicit datatype conversions are not obvious.
 
Back
Top