Question : DateTimePicker to DateTime SQL Server format

Hi All,

I have a DateTimePicker on my form in a win32 app.

What format do I use to insert the DateTime into an SQL server datetime field!?

Thanks

Answer : DateTimePicker to DateTime SQL Server format

Ok well I don't know how you are inserting into the db but this is one way

Dim insertCmd As SqlCommand
insertCmd.Parameters.Add(New SqlParameter("@Date", SqlDbType.DateTime))
insertCmd.Parameters("@Date").Value = moment

Should work. But you will have to try it. I haven't used vb for a while so not to sharp on it :P
Random Solutions  
 
programming4us programming4us