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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:59:03+00:00 2026-06-04T18:59:03+00:00

I have two questions. How can I get the SQLite Db to store data?

  • 0

I have two questions.

  1. How can I get the SQLite Db to store data? The db is created and I can find the db at its FilePath location, but I never see any data.

  2. How do I change the location to save the data in a local folder, not in the Users… appdata folder?

Here is my code:

        Database db = new Database(Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path,"alpha2.db"));
  //   Database db = new Database("c:\\Projects\\alpha2.db");

        Statement stm;
        stm = db.PrepareStatement("CREATE TABLE IF NOT EXISTS person(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT, age INTEGER, data BLOB)");
        stm.Execute();
        stm.Dispose();

        stm=db.PrepareStatement("INSERT INTO person(name,age VALUES(?,?)");
        stm.BindParamText(1,"John Doe");
        stm.BindParamInt(2,35);

        stm.Execute();
        stm.Dispose();

        long insertRowId = db.LastInsertRowId;

        stm=db.PrepareStatement("SELECT * FROM person");
            while(stm.GetNextRow())
            {
                int id=stm.GetIntAt(0);
                string name=stm.GetTextAt(1);
                textBlock1.Text=name.ToString();

            }

        stm.Dispose();
        db.Dispose();

TIA, this has been a two-day head banger.

  • 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-04T18:59:04+00:00Added an answer on June 4, 2026 at 6:59 pm

    The syntax on your insert query looks wrong. It should be more like …

    INSERT INTO person(name,age) VALUES(?,?)
    

    (Added a close paren after age.)

    You can’t write to an arbitrary location on the user’s drive from a Metro Style app. LocalFolder is your best bet.

    Edit for comment: Check out Tim’s article on Sqlite for syntax for local folder.

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

Sidebar

Related Questions

I have two questions: How can I get current year (not date) in haskell
I have two questions: 1) How can I get the IP address, and any
Simple question which I can't seem to find an answer of: I have two
I have two questions. In my webpage (developed by me), I use the GET
I have two questions. My first one is, that how can i put something
I develop my first application for WP7. I have two questions : How can
I have previously asked two questions Question 1 and Question 2 but there is
I'm using sqlite as a datasource in an iPhone app. I have two questions
I have two questions with regards to Bullet, but they are related. In the
Possible stupid question: let's say I have two apps contained within one project. Can

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.