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

  • SEARCH
  • Home
  • 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 6726711
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:57:34+00:00 2026-05-26T09:57:34+00:00

What am I doing wrong!?!?? I am trying to get a set of data

  • 0

What am I doing wrong!?!??
I am trying to get a set of data to a listview.

First I Open the database and then I trying to get the set,
I get a response but only 1 row from the database and I am getting at least 10 when I trying it in sqlite browser…..
Anyway I don’t know if this make any sense, here is the code: (i am new at this, please don’t laugh to much)

And btw I use the same methods/functions in another listview but then I don’t have any WHERE in my query and that works fine….
So I want to get all the rows from the database and i only get the first one 🙂

Thanks mates!

db.openDataBase();
Cursor c = db.getCoursesFromCountyID(countyID);
BindsimpleCursorAdapter(c);
db.close();

the getCoursesFromCountyID = 
int id = Integer.parseInt(county);
        return db.query("Courses", new String[]{KEY_course_ID, KEY_course}, KEY_county_ID + " = " + id, null, null, null, null);

And the BindsimpleCursorAdapter looks like this = 

startManagingCursor(c);
        SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, R.layout.simpleadapter_courses, c, new String[]{DataBaseHelper.KEY_course_ID, DataBaseHelper.KEY_course}, new int[]{R.id.courseID, R.id.course});
        ListView lv = new ListView(this);
        lv = (ListView)findViewById(R.id.listViewCourses);
        lv.setAdapter(adapter);
  • 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-05-26T09:57:34+00:00Added an answer on May 26, 2026 at 9:57 am

    I don’t see any problems on your code, try adding ‘KEY_county_ID’ to you projection argument and removing the selection argument to check if all the rows are really there.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What am I doing wrong here? I'm trying to get started with jQuery UI
I don't get what I'm doing wrong. I'm trying to populate a form from
I'm trying to free g_strdup but I'm not sure what I'm doing wrong. Using
Someone has to be able to explain what I'm doing wrong here! I'm trying
My code below won't compile. What am i doing wrong? I'm basically trying to
I am trying to get the next highest PK in an SQLite database that
I'm trying to get page data using cURL and sending variables via POST. Here's
I have a tableviewcontroller with data population it. I'm trying to get a new
Im trying to make a get and set to make my List<> persistent. I
I'm trying to set up a dynamic data entities web site, exactly following the

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.