ibatis-user-cs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bjorn I <b...@rocketmail.com>
Subject Re: Data Type Mismatch
Date Tue, 26 Jul 2005 13:00:33 GMT
I am using Access 2003, and my dates are set to
general date.
Statement:
INSERT INTO Tagout (PartID, DateOfSubmission,
DateCleared) VALUES (#PartID#, #DateOfSubmission#,
#DateCleared#)
I set parameterClass to a value object that contains
all the fields, and DateOfSubmission and DateCleared
are both DateTime. I populate the VO and set the dates
using DateTime.Now. I use the insert method ->
Mapper.Instance().Insert("InsertTagout", tagoutVO);
and pass in the VO. I tried setting it to
DateTime.Now.Date and it works, but then I loose any
time information. 

--- Ron Grabowski <rongrabowski@yahoo.com> wrote:

> 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 
> >  
> > 
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Mime
View raw message