Home » c# » c# – Xamarin.android Microsoft.SQLite Always return no rows

c# – Xamarin.android Microsoft.SQLite Always return no rows

Posted by: admin February 21, 2020 Leave a comment

Questions:
  string path = Path.Combine(
         System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal),
          "Service.db3");

            SqliteConnection cn = new SqliteConnection("Data Source=" + path + " ");

            List<String> entries = new List<string>();


            SqliteCommand sqCommand = (SqliteCommand)cn.CreateCommand();
            sqCommand.CommandText = $"SELECT ID FROM Members ";
            cn.Open();

  SqliteDataReader sqReader = sqCommand.ExecuteReader();

            if (sqReader.HasRows)
            {

            }
            else
            {

            }

that is my code I’m using but there is no row although I have 2 rows at the table
and if I used

SELECT name FROM sqlite_master
I got the table name that I created I don’t understand??

How to&Answers: