You are not using the constructor properly. You are attempting to pass the
value of weekending.Text to a parameter of type Int. The third parameter is
not the value parameter. It is the length parameter for the datatype. In the
case of a datetime, that should be 4 I believe. Add a 4 for the third
parameter as such:
..Add(New SqlParameter("@SQLweekending", SqlDbType.DateTime,
4,CDate(weekending.Text)))
and see what happens.
--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006
"Elmo Watson" <ew@yahoo.nospam.comwrote in message
news:OK**************@TK2MSFTNGP05.phx.gbl...
The date format in the 'weekending' textbox is 5/5/2007
Here's what I've got:
With cmd.Parameters
.Add(New SqlParameter("@SQLweekending", SqlDbType.DateTime,
weekending.Text))
the error message is:
"Conversion from string "4/8/2007" to type 'Integer' is not valid."
Then, I tried:
.Add(New SqlParameter("@SQLweekending", SqlDbType.DateTime,
CDate(weekending.Text)))
but, before I even tried it, it gave me a blue squiggly line, with an
error message:
"Error 2 Value of type 'Date' cannot be converted to 'Integer'"
How can I get this to work?