public async void LoadMessages(bool clearAll = false) { try { if (clearAll) { _mainFrm.AS_LIST_CLEAR(); } if (sqlite_conn.State != System.Data.ConnectionState.Open) { ConnectDB(); } sqlite_cmd = new SQLiteCommand("SELECT * FROM asmessage", sqlite_conn); //sqlite_datareader = sqlite_cmd.ExecuteReader(); // DbDataReader datareader = await sqlite_cmd.ExecuteReaderAsync(); //using (SQLiteDataReader reader = sqlite_cmd.ExecuteReader()) //{ using (SQLiteDataReader reader = (SQLiteDataReader)await sqlite_cmd.ExecuteReaderAsync()) { while (await reader.ReadAsync()) { if (reader.GetString(1) != null) { _mainFrm.AS_LIST_ADD(reader.GetString(1)); //Debug.WriteLine(sqlite_datareader.GetString(1)); } // _mainFrm.AS_LIST_ADD(sqlite_datareader.GetString(0).ToString()); } } sqlite_conn.Close(); } catch (System.Exception) { throw; } }