Error in select code

2006-07-19
2013-04-15
  • hi all

    sqlite newbie - i always get an error table doesnt exists - but when is query with sqlite than i get a result - thanks for every hint
    -----

    SQLiteCommand sqlite_select = new SQLiteCommand();
                    sqlite_select = sqlite_connection.CreateCommand();
                   
                    sqlite_select.CommandText = "SELECT * FROM Word WHERE field1 = \"" + token + "\"";

                    // Now the SQLiteCommand object can give us a DataReader-Object:
                    SQLiteDataReader sqlite_datareader = sqlite_select.ExecuteReader();
                    sqlite_datareader.Read();
                  
                    // The SQLiteDataReader allows us to run through the result lines:
                    while (sqlite_datareader.Read()) // Read() returns true if there is still a result line to read
                    {
                        // Print out the content of the text field:
                        System.Console.WriteLine("\n" + sqlite_datareader["text"] + "\n");
                    }