Hi
Title is auto descriptive so here is the code:
Where Query = Insert Into Table (Col1, Col2 etc...) Values (Val1, Val2 etc...)
Private Function Insert(ByVal Query As String) As Integer
SQLCommand.CommandText = Query
Connection.Open()
Dim ID As Integer
ID = SQLCommand.ExecuteScalar()
Connection.Close()
Return ID
End Function
It's inserting the row into the table but the ID variable always shows 0
Title is auto descriptive so here is the code:
Where Query = Insert Into Table (Col1, Col2 etc...) Values (Val1, Val2 etc...)
Private Function Insert(ByVal Query As String) As Integer
SQLCommand.CommandText = Query
Connection.Open()
Dim ID As Integer
ID = SQLCommand.ExecuteScalar()
Connection.Close()
Return ID
End Function
It's inserting the row into the table but the ID variable always shows 0