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

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -