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 7965157
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T06:04:16+00:00 2026-06-04T06:04:16+00:00

i am stuck here, unable to find whats the problem it insert the data

  • 0

i am stuck here, unable to find whats the problem
it insert the data twice with same values but it autoIncrement Id , do help me out .. i want to add single record at a time

if(count>0)
                        {
                            sing.gs.updateSettings();
                            Toast.makeText(this, "Settings Updated", 5000).show();
                        }
                    else
                        {
                            sing.gs.addSettings();

ADD SETTING METHOD IN GETTER SETTER THAT I USED TO CALL IN MY ACTIVITY

public void addSettings()
    {
        dbm.addSettings(

                golfCourse,
                address,
                phone, 
                userName, 
                userEmail, 
                applicator1, 
                applicator2, 
                applicator3, 
                applicator4, 
                supersEmail, 
                assistSupersEmail, 
                sprayTechEmail, 
                clubMangEmail);
    }

ADD SETTING METHOD IN DATABASE MANAGER CLASS WHICH IS RESPONSIBLE TO INSERT DATA IN DATA BASE
//ADDING SETTINGS
public void addSettings (

            String gc,
            String add,
            String ph,
            String un,
            String ue,
            String ap1,
            String ap2,
            String ap3,
            String ap4,
            String se,
            String ase,
            String ste,
            String cme
            )
    {
        ContentValues values = new ContentValues();

        values.put(Cgc_golf_course, gc);
        values.put(Caddress, add);
        values.put(Cphone, ph);
        values.put(Cun_user_name, un);
        values.put(Cue_user_email, ue);
        values.put(Cap1, ap1);
        values.put(Cap2, ap2);
        values.put(Cap3, ap3);
        values.put(Cap4, ap4);
        values.put(Cse_supers_email, se);
        values.put(Case_assist_supers_email, ase);
        values.put(Cste_spray_tech_email, ste);
        values.put(Ccme_club_manager_email, cme);

        try {
            a++;
            db.insert(TABLE_NAME, null, values);
            insertId = (db.insert(TABLE_NAME, null, values));


        } catch (Exception e) {
            Log.e("DB ERROR", e.toString());
            e.printStackTrace();
        }
    }
  • 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-04T06:04:18+00:00Added an answer on June 4, 2026 at 6:04 am

    You are calling the insert twice in the following code:

            db.insert(TABLE_NAME, null, values);
            insertId = (db.insert(TABLE_NAME, null, values));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Kinda stuck here... I have an application with lets say 5000 rows of data
I am stuck here, any help would be appreciated. I have a listbox of
I am stuck here and i spend last 2 days resolving this issue but
i know this is basic but somehow i have been stuck here for some
I'm reading the Michael Hartl's Ruby on Rails Turorial but I'm stuck here .
I have what I think is a simple problem but have been unable to
Can anyone help me here. I am really stuck. In my code if no
Got stuck here: http://jsfiddle.net/UFkg8/ Right now the animation is top-down. What do I need
A little stuck here. I have a simple question I guess. Given the following
Sorrry guys, I'm stuck here. I have a few grids, I also have CollectionViewSource

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.