Date/Time Strange Problem
- From: "Shapper" <mdmoura*NOSPAM*@gmail.*DELETE2SEND*com>
- Date: Thu, 30 Jun 2005 23:18:08 +0000
Hello,
I am having an error when inserting a record in an Access database.
The field [publication_date] is of Date/Time type.
This is my query and the parameters for that field:
Dim queryString As String = "INSERT INTO [t_news] ([title], [text], [publication_date]) VALUES (@title, @text, @publication_date)"
Dim dbCommand As IDbCommand = New OleDbCommand dbCommand.CommandText = queryString dbCommand.Connection = dbConnection
With dbCommand.Parameters
.Add(New OleDbParameter("@title", "sample"))
.Add(New OleDbParameter("@text", "sample"))
.Add(New OleDbParameter("@publication_date", DateTime.Now))
End WithI get the error "Data type mismatch in criteria expression."
What is wrong here?
Thanks, Miguel
.
- Follow-Ups:
- RE: Date/Time Strange Problem
- From: Jouni Karppinen
- Re: Date/Time Strange Problem
- From: bhawin13
- RE: Date/Time Strange Problem
- Prev by Date: Re: Debugging Global.asax
- Next by Date: Re: Problems Deploying Data Access Application Block
- Previous by thread: Re: Debugging Global.asax
- Next by thread: Re: Date/Time Strange Problem
- Index(es):