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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:57:23+00:00 2026-06-14T20:57:23+00:00

This code i write in m registr activity but it give me error ANR

  • 0

This code i write in m registr activity but it give me error ANR and not generating the database

this code on the register button

SQLiteDatabase db = openOrCreateDatabase("RoseDetails",MODE_APPEND, null);
    //          db.execSQL("create table if not exists table_register(firstname VARCHAR(20),lastname VARCHAR(20),emailaddress VARCHAR(20),gender VARCHAR(20),password VARCHAR(20),confirmpassword VARCHAR(20)");
    //          db.execSQL("INSERT into table_student values('"+firstname.getText()+"','"+lastname.getText()+"','"+emailid.getText()+"','"+gendervaule+"','"+Pwd.getText()+"','"+"','"+cpwd.getText()+"')");
    //          Cursor c=db.rawQuery("SELECT * FROM table_register" , null);
    //          while(c.moveToNext())
    //          {   
    //          if(c.moveToFirst())
    //          {
    //              String fn=c.getString(c.getColumnIndex("firstname"));
    //              String ln=c.getString(c.getColumnIndex("lastname"));
    //              String add=c.getString(c.getColumnIndex("emailaddress"));
    //              String g=c.getString(c.getColumnIndex("gender"));
    //              String p1=c.getString(c.getColumnIndex("password"));
    //              String p2=c.getString(c.getColumnIndex("confirmpassword"));
    //              Toast.makeText(this,"firstname"+fn+"\t"+"lastname"+ln+"\t"+"emailid"+add+"\t"+"gender"+g+"\t"+"pass"+p1+"\t"+"cpwd"+p2,Toast.LENGTH_LONG).show();
    //          }
    //          } 
    //          c.close();
    //          db.close();

logcat error

11-24 08:01:00.163: W/dalvikvm(278): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
11-24 08:01:00.193: E/AndroidRuntime(278): FATAL EXCEPTION: main
11-24 08:01:00.193: E/AndroidRuntime(278): android.database.sqlite.SQLiteException: near ")": syntax error: create table if not exists table_register(firstname VARCHAR(20),lastname VARCHAR(20),emailaddress VARCHAR(20),gender VARCHAR(20),password VARCHAR(20),confirmpassword VARCHAR(20)
11-24 08:01:00.193: E/AndroidRuntime(278):  at android.database.sqlite.SQLiteDatabase.native_execSQL(Native Method)
11-24 08:01:00.193: E/AndroidRuntime(278):  at android.database.sqlite.SQLiteDatabase.execSQL(SQLiteDatabase.java:1727)
11-24 08:01:00.193: E/AndroidRuntime(278):  at com.example.orderplacemnet.Registration_Page.onClick(Registration_Page.java:158)
11-24 08:01:00.193: E/AndroidRuntime(278):  at android.view.View.performClick(View.java:2408)
11-24 08:01:00.193: E/AndroidRuntime(278):  at android.view.View$PerformClick.run(View.java:8816)
11-24 08:01:00.193: E/AndroidRuntime(278):  at android.os.Handler.handleCallback(Handler.java:587)
11-24 08:01:00.193: E/AndroidRuntime(278):  at android.os.Handler.dispatchMessage(Handler.java:92)
11-24 08:01:00.193: E/AndroidRuntime(278):  at android.os.Looper.loop(Looper.java:123)
11-24 08:01:00.193: E/AndroidRuntime(278):  at android.app.ActivityThread.main(ActivityThread.java:4627)
11-24 08:01:00.193: E/AndroidRuntime(278):  at java.lang.reflect.Method.invokeNative(Native Method)
11-24 08:01:00.193: E/AndroidRuntime(278):  at java.lang.reflect.Method.invoke(Method.java:521)
11-24 08:01:00.193: E/AndroidRuntime(278):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
11-24 08:01:00.193: E/AndroidRuntime(278):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
11-24 08:01:00.193: E/AndroidRuntime(278):  at dalvik.system.NativeStart.main(Native Method)
  • 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-14T20:57:25+00:00Added an answer on June 14, 2026 at 8:57 pm

    You forgot to add the closing parenthesis in this line at the end

     db.execSQL("create table if not exists table_register(firstname VARCHAR(20),lastname VARCHAR(20),emailaddress VARCHAR(20),gender VARCHAR(20),password VARCHAR(20),confirmpassword VARCHAR(20)");
    

    it should be

      db.execSQL("create table if not exists table_register(firstname VARCHAR(20),lastname VARCHAR(20),emailaddress VARCHAR(20),gender VARCHAR(20),password VARCHAR(20),confirmpassword VARCHAR(20))");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code to write to a file, it works perfect but I
I have write this code but it does work only if I am already
I've write this code to add textview into table row, but I've problem for
I got error when I write this code @Html.X().ResourceManager() in view error message :
I am using this code to write asynchronously to a file public static void
I write this code to get Dunnet anova post hoc test import rpy2.robjects as
would someone please write this code: this.Loaded += (s, e) => this.loaded = true;
How can I write this code more cleanly/concisely? /// <summary> /// Creates a set
how can i write this code from aspx page in code behind? <a href=skype:MySkype?call><img
i write this code in main.java ArrayList<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(); try{ HttpClient httpclient

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.