in

System.Data.SQLite

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

GetSchema cast error on foriegn keys

Last post 03-20-2008 8:43 AM by Robert Simpson. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 02-28-2008 2:49 PM

    • Paul
    • Top 500 Contributor
    • Joined on 09-12-2007
    • Posts 3

    GetSchema cast error on foriegn keys

    Do you know how to get past this error? The create table sql is full of foriegn key contraints (and are based on sql server sql), but my understanding is that these are parsed but ignored. The database tables create ok, but fail on GetSchema. 

     

    "Specified cast is not valid." 

       at System.Data.SQLite.SQLiteDataReader.VerifyType(Int32 i, DbType typ)
       at System.Data.SQLite.SQLiteDataReader.GetString(Int32 i)
       at System.Data.SQLite.SQLiteConnection.Schema_ForeignKeys(String strCatalog, String strTable, String strKeyName)
       at System.Data.SQLite.SQLiteConnection.GetSchema(String collectionName, String[ restrictionValues)
       at System.Data.SQLite.SQLiteConnection.GetSchema(String collectionName)
       at SqliteConsoleTest.Form1.ReadSchema() in ...\Form1.cs:line 43


    Code: 

    public static void ReadSchema()
    {
        Console.WriteLine("ReadSchema");
       
        SQLiteConnection conn = new SQLiteConnection("data source=item.db3");
        conn.Open();

        DataTable dt = conn.GetSchema("FOREIGNKEYS");

    }
     

  • 03-05-2008 11:50 AM In reply to

    • Paul
    • Top 500 Contributor
    • Joined on 09-12-2007
    • Posts 3

    Re: GetSchema cast error on foriegn keys

     Sort of makes sqlite unusable. Anyone care about this issue?

     

     

  • 03-05-2008 5:34 PM In reply to

    Re: GetSchema cast error on foriegn keys

    Send me a copy of the database so I can have a look.  robert at blackcastlesoft dot com

     

  • 03-19-2008 11:33 AM In reply to

    • Paul
    • Top 500 Contributor
    • Joined on 09-12-2007
    • Posts 3

    Re: GetSchema cast error on foriegn keys

     I sent the database a couple of weeks ago. Anything?

     

  • 03-20-2008 8:43 AM In reply to

    Re: GetSchema cast error on foriegn keys

    Sorry, I've been working 90 hours a week for the last month and haven't had time to breathe.  I'll look into it as soon as I can.

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