Problems doing an SQL insert statement on datetimestamp
I get the following error message when trying to run the code posted below...
"Prepared statement '(@datestamp datetime,@PrevValue real,@NewValue real,@IPaddress r' expects parameter @datestamp, which was not supplied."
I have tried the following code with the quotes, without quotes and every other way it seems like. Without the quotes, the statement doesn't like the spaces in the timestamp. What should/could I do to fix this?
My code:
PrivateSub UpdateRefresh()UpdateConnection.Open()
UpdateDataAdapter.InsertCommand.CommandText = "INSERT INTO dbo.tbDeploy(datestamp," & _
"PrevValue, NewValue, IPaddress, HighCapability, LowCapability, Share) VALUES" & _
"('" & DateTime.Now & "', '" & lblCurrent.Text & "', '" & lblCurrent.Text & _
"', '" & lblIP.Text & "', '" & lblHigh.Text & "', '" & lblLow.Text & "', '" & lblShare.Text & "')"
UpdateDataAdapter.InsertCommand.ExecuteNonQuery()
UpdateConnection.Close()
EndSub
