|
|
|
start date: Wed, 25 Jul 2007 22:44:17 -0400,
posted on: microsoft.public.dotnet.languages.vb.data
back
| Thread Index |
|
1
Tony M
|
|
2
Paul Clement
|
|
3
Michel Posseth [MCP]
|
Pass date as parameter to Access DB
ASP .net - webforms
I changing things from sql string concatenation to parameters, for sql
injection reasons.
I keep getting a data type mismatch error.
I know the field / column is date/time and it worked with the string
concatenation .
OleCmd.Parameters.AddWithValue("LastChangeTime", Now)
Can someone tell me how to pass a date (Now)?
Thanks
Date:Wed, 25 Jul 2007 22:44:17 -0400
Author:
|
Re: Pass date as parameter to Access DB
On Wed, 25 Jul 2007 22:44:17 -0400, "Tony M" wrote:
ASP .net - webforms
I changing things from sql string concatenation to parameters, for sql
injection reasons.
I keep getting a data type mismatch error.
I know the field / column is date/time and it worked with the string
concatenation .
OleCmd.Parameters.AddWithValue("LastChangeTime", Now)
Can someone tell me how to pass a date (Now)?
You probably need to specify the data type of the parameter:
System.Data.OleDb.OleDbType.Date
Paul
~~~~
Microsoft MVP (Visual Basic)
Date:Thu, 26 Jul 2007 11:18:02 -0500
Author:
|
Re: Pass date as parameter to Access DB
I addition to Paul`s response
it is also possible to pass the date as a string ( i prefer ISO 8601 )
"Tony M" schreef in bericht
news:%23Os0i7yzHHA.5052@TK2MSFTNGP04.phx.gbl...
> ASP .net - webforms
>
> I changing things from sql string concatenation to parameters, for sql
> injection reasons.
>
> I keep getting a data type mismatch error.
>
> I know the field / column is date/time and it worked with the string
> concatenation .
>
> OleCmd.Parameters.AddWithValue("LastChangeTime", Now)
>
>
>
> Can someone tell me how to pass a date (Now)?
>
>
>
> Thanks
>
>
Date:Thu, 26 Jul 2007 18:38:30 +0200
Author:
|
|
|