Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8938031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:31:52+00:00 2026-06-15T10:31:52+00:00

I do not have a class map to a table. I’m referring to the

  • 0

I do not have a class map to a table. I’m referring to the following thread. The get the number of row in a table, I am applying the following technique

How to perform raw SQLite query through SQLiteAsyncConnection

SQLiteAsyncConnection conn = new SQLiteAsyncConnection(DATABASE_NAME);
int profileCount = await conn.ExecuteScalarAsync<int>("select count(*) from " + PROFILE_TABLE);

Now, instead of obtaining result as number of row, I would like to retrieve result in multiple row data.

In Java, to obtain multiple row result data, I would perform

Cursor cursor = database.rawQuery(sql, null);
cursor.moveToFirst();
while (!cursor.isAfterLast()) {
    // For every cursor, obtain its col data by 
    // cursor.getLong(0), cursor.getInt(1), ...
    cursor.moveToNext();
}

Given a same sql statement, how can I achieve using SQLiteAsyncConnection?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T10:31:53+00:00Added an answer on June 15, 2026 at 10:31 am

    I added 2 new functions into SQLite.cs. Not elegant, but it works for me.

        // Invented by yccheok :)
        public IEnumerable<IEnumerable<object>> ExecuteScalarEx()
        {
            if (_conn.Trace)
            {
                Debug.WriteLine("Executing Query: " + this);
            }
    
            List<List<object>> result = new List<List<object>>();
            var stmt = Prepare();
    
            while (SQLite3.Step(stmt) == SQLite3.Result.Row)
            {
                int columnCount = SQLite3.ColumnCount(stmt);
    
                List<object> row = new List<object>();
                for (int i = 0; i < columnCount; i++)
                {
                    var colType = SQLite3.ColumnType(stmt, i);
                    object val = ReadColEx (stmt, i, colType);
                    row.Add(val);
                }
                result.Add(row);
            }
            return result;
        }
    
        // Invented by yccheok :)
        object ReadColEx (Sqlite3Statement stmt, int index, SQLite3.ColType type)
        {
            if (type == SQLite3.ColType.Null) {
                return null;
            } else {
                if (type == SQLite3.ColType.Text) {
                    return SQLite3.ColumnString (stmt, index);
                }
                else if (type == SQLite3.ColType.Integer)
                {
                    return (int)SQLite3.ColumnInt (stmt, index);
                }
                else if (type == SQLite3.ColType.Float)
                {
                    return SQLite3.ColumnDouble(stmt, index);
                }
                else if (type == SQLite3.ColType.Blob)
                {
                    return SQLite3.ColumnBlob(stmt, index);
                }
                else
                {
                    throw new NotSupportedException("Don't know how to read " + type);
                }
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In the following code, it seems class C does not have access to A's
I have a class which does not have copy constructor or operator= overloaded. The
Is there a reason why java does not have a class which allows both
I am attempting to select all a hrefs that do not have the class
can you please help me with this issue the String class does not have
Let's say I have a class (not a static class), A , that in
I have a class that holds a few vectors, I'm not sure which method
I have a C# class method that return a xml document not file. How
If I have a .Net class that is not part of any namespace then
I have a SimpleProducerConsumer class that illustrates a consumer/producer problem (I am not sure

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.