SQLite Forum

SQL-Query is always empty
Login
Hello guys,</br>
while programming a database I ran into a problem with some SQL-Queries.
<Code>
SqliteConnection conn = new SqliteConnection("data source = " + pathtoDB);

                SqliteCommand selectMaxValue = new SqliteCommand();
                selectMaxValue.Connection = conn;
                selectMaxValue.CommandText = "SELECT myValue FROM myTable;";

                conn.Open();

                SqliteDataReader reader = selectMaxValue.ExecuteReader();
                while (reader.Read())
                {
                    int maxValue = int.Parse(reader["myValue"].ToString());
                    Console.WriteLine(maxValue);
                }

                conn.Close();
</Code>
This code gives me the values I want. But if I change the Query to "SELECT MAX(myValue) FROM myTable;" or "SELECT myValue FROM myTable WHERE 'something'" the result in reader is empty.</br>
If I try the queries in a shell it works just fine (so nothing wrong with my database).</br>
Why is it that I can't run other queries?</br>
Thanks in advance