SQLite Insert return ID...

lidds

Well-known member
Joined
Oct 19, 2004
Messages
122
Programming Experience
Beginner
I'm not sure if this is the right place to place this question..... I am using SQLite and what I am doing is passing a simple SQL statement to the database, however I want to also return the Unique ID that the insert statement has been entered to, however I am not sure how to do this within a single SQL statment.

My code is below:

VB.NET:
Dim mySQL As String = "INSERT INTO DisplaySetFolderTbl (parentID, folderName) VALUES ('" & selNode.Tag & "','" & Trim(Me.txtName.Text) & "')"

        Dim cmd As New SQLiteCommand(mySQL, MISData.Instance.dbDRV)

        Try
            cmd.ExecuteNonQuery()
        Catch
            Exit Sub
        End Try

MISData.Instance.dbDRV is the connection string

Thanks

Simon
 
Back
Top