System.ArgumentNullException

2004-07-04
2004-07-10
  • Nobody/Anonymous

    Create Table Statement:
    SQLCommand.CommandText = "CREATE TABLE files (id PRIMARY KEY, filename UNIQUE)"

    Insert Statement:
    SQLCommand.CommandText = String.Format("INSERT INTO files (filename) VALUES (" + Chr(34) + "{0}" + Chr(34) + ")", Filename)

    Query:
    SQLCommand.CommandText = "SELECT * FROM files" ' WHERE id = " + ID.ToString
    SQLReader = SQLCommand.ExecuteReader
    While SQLReader.Read
    MsgBox(SQLReader.GetString(0))
    End While

    The Query results with an System.ArgumentNullException in finisar.sqlite.dll. Can someone help me out?? Email: anatomiepraktikant at quantentunnel.de

     
    • Alexander Gavrilov

      You're getting ArgumentNullException because SQLite doesn't generate ID for you. To be ID autogenerated, you have to declare ID field as INTEGER PRIMARY KEY, not as PRIMARY KEY.

       
    • Nobody/Anonymous

      Gotme!! Big THX!!

       

Log in to post a comment.