I have this code:
That is all I have so far... I basically just want to store the date in one field, and time in another (time down to the minutes is fine)...
How can I do this? with my above code, I get an error about date1 not being able to be there or something..
ideas?
thanks
Lee
Code:
Dim connString As String = "Provider=SQLOLEDB.1;User Id=sa;Password=password;Initial Catalog=Northwind;server=localhost;Use Encryption for Data=False"
Dim myconnection As OleDbConnection = New OleDbConnection(connString)
If the connection string is null, use a default.
Dim date1 As String = Date.Today.ToString("yy-MM-dd")
Try
Dim myInsertQuery As String = "INSERT INTO DateTimePayload (Date) Values(date1)"
Dim myCommand As New OleDbCommand(myInsertQuery)
myCommand.Connection = myconnection
myconnection.Open()
myCommand.ExecuteNonQuery()
myCommand.Connection.Close()
Catch
MsgBox(Err.Description)
End Try
That is all I have so far... I basically just want to store the date in one field, and time in another (time down to the minutes is fine)...
How can I do this? with my above code, I get an error about date1 not being able to be there or something..
ideas?
thanks
Lee