How to get a number ( int ) obtained as a result of such a SQL query:
SELECT id FROM table1 WHERE name="name" It turns out to output only with the use of foreach , which is very cumbersome:
SQLiteDataReader reader = command.ExecuteReader(); foreach (DbDataRecord item in reader) { intvalue = Convert.ToInt32(item["id"]); } This is probably more correct, because the MAX function is working.
foreach, whose body consists of a single line? - Regent