I have this code
Dim str As String
Dim myConn As SqlConnection = New SqlConnection("Server=JDBRANDE;Integrated Security=SSPI;Persist Security Info=False")
Dim myCommand As SqlCommand
Try
myConn.Open()
str = "insert into orders_table(tuid,customer_tuid,start_time,finish_time ) " + " VALUES ('2342', '455', 'NULL', 'NULL')"
'MsgBox(str)
myCommand = New SqlCommand(str, myConn)
myCommand.ExecuteNonQuery()
I keep getting an invalid object name orders_table error
When I go directly to SQL Server and type in the insert statement, it works.
You connection string is either pointing to a database different from the one your manually referring to, one that does not have that table, and/or you’ve got the name wrong in the sql statement.
Edit – Hmm what the other answers say about missing the schema/initial catalog is most likely your problem.