ibatis-user-cs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ron Grabowski <rongrabow...@yahoo.com>
Subject Re: Data Type Mismatch
Date Tue, 26 Jul 2005 03:45:24 GMT
I use IBatisNet, DateTime objects, and Access. Could you post the
<statement> you're using and how its being called? I'm using Access
2002. The Format drop down is set to nothing.

If you are using Access to store just the date, have you tried passing
in the .Date property of the DateTime object?

 map["StartDate"] = startDate.Date;

 ExecuteUpdate("update", map);

--- Bjorn I <bei1@rocketmail.com> wrote:

> I also tested the tutorial that came with 1.2.1 for
> the .Net version. If you set the birthdate in the
> PersonInsertDelete method in PersonTest.cs it also
> fails with the same error.
> 
> 
> 
> --- Bjorn I <bei1@rocketmail.com> wrote:
> 
> > After I updated from 1.1 to 1.2.1 I recieved this
> > error while trying to insert a record:
> > System.Data.OleDb.OleDbException: Data type mismatch
> > in criteria expression.
> > Server stack trace: 
> >    at
> >
> System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(Int32
> > hr)
> > 
> >    at
> >
>
System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS
> > dbParams, Object& executeResult)
> > 
> >    at
> >
> System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object&
> > executeResult)
> > 
> >    at
> >
> System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior
> > behavior, Object& executeResult)
> > 
> >    at
> >
> System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior
> > behavior, String method)
> > 
> >    at
> > System.Data.OleDb.OleDbCommand.ExecuteNonQuery()
> > 
> >    at
> >
>
IBatisNet.DataMapper.MappedStatements.MappedStatement.ExecuteInsert(IDalSession
> > session, Object parameterObject)
> > 
> >    at IBatisNet.DataMapper.SqlMapper.Insert(String
> > statementName, Object parameterObject)
> > 
> > The field in question is a Date field. It's set as
> > General Date in the access DB, and the passed in
> > value
> > is DateTime.Now. This used to work fine with 1.1. 
> > 
> > 
> > 
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> > protection around 
> > http://mail.yahoo.com 
> > 
> 
> 
> 
> 		
> ____________________________________________________
> Start your day with Yahoo! - make it your home page 
> http://www.yahoo.com/r/hs 
>  
> 


Mime
View raw message