c# - SQLiteDataReader error, near "table": syntax error -


i have simple sqlite db table in c# project database screenshot

here code using retrieve data db:

sqliteconnection dbconnection; dbconnection = new sqliteconnection("data source=./new.db;"); dbconnection.open(); if (dbconnection.state == system.data.connectionstate.open)      richtextbox3.text = "conn"; string sqlcommand = "select age table index=1"; sqlitecommand command = new sqlitecommand(sqlcommand, dbconnection); sqlitedatareader result = command.executereader(); if(result.hasrows) {       while (result.read())       {            richtextbox1.text = result.getint32(0) + " "+ result.getstring(1) + " " + result.getint32(2);        }  } 

maybe while loop incorrect problem syntax error near table.

as @rohit mentioned table keyword in sqlite if still want use can change query below: surrounding table name [table]

string sqlcommand = "select age [table] index=1"; 

it works in sqlserver


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -