Results 1 to 2 of 2

Thread: SQLite Insert return ID...

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2006
    Posts
    170

    SQLite Insert return ID...

    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:

    Code:
    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

  2. #2
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,493

    Re: SQLite Insert return ID...

    Does SQLLite allow more then one statement on a command? If so you probably seperate the commands with a semi-colon ( ; ).
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width