SQLiteDataAdapter does not populate the specified DataTable
I am trying to fetch some data from a SQLite database so that I can populate a GridView in my GUI: here is the code that returns the DataTable:
DataTable table = new DataTable();
SQLiteDataAdapter adapter = new SQLiteDataAdapter(this.command.CommandText, this.connection);
adapter.Fill(table);
return table;
For some reason, after the call adapter.Fill
, the DataTable is still not filled with anything. So far, I have verified that the command text is correct and that the connection contains the correct connection string. Both are used successfully in other parts of the application. No exceptions seem to be thrown ... Is there still a place I should look for trouble? Am I using the API incorrectly?
Thanks!
a source to share
This looks like a correct use.
One thing to check is after filling you say the data is not filling. Did you just check Rows.Count? How about columns? If Fill creates columns according to your SELECT statement, but there are no rows, then you know the code works, but there is a problem with your query, or you are not in the same database as you.
a source to share