Hello John,
There's no need to convert it to string..
Dim tConnection As SqlConnection = New SqlConnection("connection string here")
Dim tCommand as SqlCommand = New SQlCommand
With tCommand
.Connection = tConnection
.CommandType = CommandType.Text
.CommandText = "INSERT INTO someTable (dateField) VALUES (@dateValue)
.Parameters.AddWithValue("@dateValue", Now)
End With
tConnection.Open
tCommand.ExecuteNonQuery
tConnection.Close
Enjoy,
-Boo
> Hi,
>
[quoted text clipped - 20 lines]
>
> John
Cor Ligthert [MVP] - 30 Aug 2006 06:27 GMT
In addition to Boo,
As you have done it correct of course and your DateTime is a real DateTime
field in your database and not a string as sometimes is done.
Cor
> Hello John,
>
[quoted text clipped - 42 lines]
>>
>> John