in

System.Data.SQLite

An open-source, enhanced version of the SQLite database engine for Windows

autoincrement column from database

Last post 11-28-2007 8:34 AM by Robert Simpson. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 08-13-2007 4:29 AM

    • Wiaz
    • Top 10 Contributor
    • Joined on 01-11-2007
    • Poland
    • Posts 47

    autoincrement column from database

    is it hard to implement property like: bool GetAutoincementPrimaryKeyValueFromDataSource (true/false) to the primary key column that after dataadapter.insert will get last_insert_rowid() and set this value to proper column in datatable? it would easy application developing, i think:) or maybe it is easy way to get aptodate values of ID column in e.g. datagridview after insert new records?
    Wiaz
    Filed under:
  • 11-26-2007 7:28 PM In reply to

    • Snax
    • Top 500 Contributor
    • Joined on 08-30-2007
    • Posts 3

    Re: autoincrement column from database

    You can query table 'sqlite_.sequences' to find all tables which they have autoincrement PKs.

    Then use connection.GetSchema("columns") to get all PKs.

    Filed under:
  • 11-28-2007 8:34 AM In reply to

    Re: autoincrement column from database

    You can call GetSchemaTable() on an open DbDataReader to get information about a particular query and whether or not a particular column in the query is an AutoIncrement column as well.

    Robert

     

Page 1 of 1 (3 items)
Powered by Community Server (Commercial Edition), by Telligent Systems