I've written an SQL query using stringbuilder and send it off to the database using SqlteDataReader as seen below:
string criteria = String.Format("SELECT tile_id FROM {0} WHERE zoom_level = 14", dbTable);
SQLiteCommand command = new SQLiteCommand(criteria, dbConn);
SQLiteDataReader reader = command.ExecuteReader();
while (reader.Read())
{
Console.WriteLine("Starting reader: \n");
foreach (var i in reader)
{
Console.WriteLine(i);
}
}
isMet = true;
}
catch (Exception E )
{
Console.Write(E.StackTrace);
}
dbTable == map. I've ran the above SQL query through an SQLite browser and it's pulled back the correct information.
The returned value is always System.Data.Common.DataRecordInternal and after some Googling around I'm still a little lost. A lot of solutions that I've found implement a DataReader which solves the issue but I'm already using one.
tile_id is stored as TEXT in SQLite, and so far I've tried to retrieve it formatted as string, var and int, all of which have returned the above value.
Can anyone offer some advice?