in

System.Data.SQLite

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

delete all rows in a table error

Last post 01-19-2008 4:18 PM by slaterm. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 09-13-2007 12:06 AM

    delete all rows in a table error

    Hi again, I have one more question. I am trying to clear a table in the underlying database before adding new rows. I am using tableadapters on my form (.net). The documentation says that I can add a query to the tableadapters and simply run that query in the code to perform a delete. It will be carried out on the database as well as the datasource. The problem is that I cannot seem to write the correct sql for this delete query.

     I am trying to write:   DELETE * FROM my_pages

     But when I try to execute this query I receive an error:  Unable to parse query text.

     

    So I changed the sql to: DELETE page_id FROM my_pages

    Now I get: Missing FROM clause.
    Unable to parse query text.

    Can anyone tell me what I am doing wrong?

     

    Thanks so much for any help.

  • 09-13-2007 12:46 AM In reply to

    Re: delete all rows in a table error

    OK - I figured it out. Bad syntax - the line should simply be:   DELETE FROM my_pages

     

    Sorry to have bothered you with this one!

  • 01-19-2008 4:18 PM In reply to

    Re: delete all rows in a table error

     Anothe way to do it could be "TRUNCATE TABLE my_pages"

     

     

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