0
votes

i have created dynamic tables in Xamarin forms by using SQLite queries

string cmdStr="CREATE TABLE Mytable ...."; i am able to create table using

SQLiteCommand command = new SQLiteCommand(sqlitConnection);
command.CommandText = cmdStr;
command.ExecuteNonQuery();

the above code is working fine ,i am able to save data to sql lite db

i am unable to get data from db using command.ExecuteQuery() using command string as "select * from Mytable". as seen in screenshot i am unable to fetch content from dynamic tables,please suggest any alternatives

enter image description here

1
please do NOT post code or errors as images! - Jason

1 Answers

0
votes

The error message tells you exactly what is wrong - you are not specifying a Type argument T. The correct syntax is

List<T> results = command.ExecuteQuery<T>();

where T is the name of the class you are mapping the results to