in

System.Data.SQLite

An open source ADO.NET provider for the SQLite database engine

How I get DatabaseObjects and DatabaseObjectsProperties

Last post 08-06-2010 7:24 AM by Robert Simpson. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 08-05-2010 9:00 AM

    How I get DatabaseObjects and DatabaseObjectsProperties

    Hi, i'm writing an application in C# and need to know how to get DatabaseObjects and DatabaseObjectsProperties of my database in SQLite. For example, in SQL2005 obtain DatabaseObjects is in this way:

    SET NOEXEC OFF
        select name, xtype, id
        from [{0}].dbo.sysobjects
        where name like ('{1}%') and xtype in ('U','V')
        order by xtype, name

    How a can do this for SQLite

    Thanks. 

  • 08-06-2010 2:57 AM In reply to

    Re: How I get DatabaseObjects and DatabaseObjectsProperties

    With

    select * from sqlite_master

    you will find all table names and sql to create the table

    With 

    pragma Table_info( <table name> )  

    you will find details about fields

    Luc Wuyts
    http://www.a-d-e.net
  • 08-06-2010 5:37 AM In reply to

    Re: How I get DatabaseObjects and DatabaseObjectsProperties

    Thank you for your answer, i could resolve with pragma
  • 08-06-2010 7:24 AM In reply to

    Re: How I get DatabaseObjects and DatabaseObjectsProperties

    I highly recommend using DbConnection.GetSchema(), which is generic, and can be used on multiple database engines without writing customized code.

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