Dan,
You should be using a parameterized query for your SQL statement.
Basically, you would create a SqlCommand (or OleDbCommand, etc, etc), with
the command text of the command like this:
select * from table where datefield = @datefield
Then, you would add the appropriate parameter to the parameters
collection on the command, and set the value of that to a DateTime instance.
When you execute the command, the provider will be responsible for
performing the necessary conversions in the sql statement to a
representation that the database server can understand.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Dan" <dl****@amfam.com> wrote in message
news:7e**************************@posting.google.c om...
I have a date field on a C# form I would like to use in the WHERE
clause of a SQL statement going against Access2002. Do I need to
perform a todate() type funtion on the textbox field on the form? What
would the SQL statement look like?
Thanks in advance - Dan