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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T05:24:45+00:00 2026-06-02T05:24:45+00:00

This may be a stupid question and if it is then I apologize. I

  • 0

This may be a stupid question and if it is then I apologize. I have a program in which the user inputs data into a windows form and clicks a button. That button saves the inputted data into an MS Access 2010 database.

My question is this: After the button is clicked and the data is saved, should I be able to see the saved data if I open the database from Access? When I run the program I do not get any error messages and everything appears to be working, but when I open the table from Access, it’s empty. Is this because opening the database from Access opens a different instance or is it that the data just isn’t being saved?

Here is the code from the Form class:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace P90XProgram
{
    public partial class AbRipperXForm : Form
    {
        private AbRipperXBOL busObject = 
           new AbRipperXBOL();        

        //default constructor
        public AbRipperXForm()
        {
            InitializeComponent();
            busObject.InitializeConnection();
        }

        //event handler for data input
        private void btnEnterAbRipperXInfo_Click(object sender, EventArgs e)
        {
            //convert input data to int datatype and assign to properties
            busObject.InAndOuts = int.Parse(this.txtInAndOuts.Text);
            busObject.ForwardBicycles = int.Parse(
                this.txtForwardBicycles.Text);
            busObject.ReverseBicycles = int.Parse(
                this.txtReverseBicycles.Text);
            busObject.CrunchyFrog = int.Parse(this.txtCrunchyFrog.Text);
            busObject.CrossLegWideLegSitups = int.Parse(
                this.txtCrossLegWideLegSitups.Text);
            busObject.FiferScissors = int.Parse(this.txtFiferScissors.Text);
            busObject.HipRockNRaise = int.Parse(this.txtHipRockNRaise.Text);
            busObject.PulseUpsHeelsToHeaven = int.Parse(
                this.txtPulseUpsHeelsToHeaven.Text);
            busObject.VUpRollUpCombos = int.Parse(this.txtVUpRollUpCombos.Text);
            busObject.ObliqueVUps = int.Parse(this.txtObliqueVUps.Text);
            busObject.LegClimbs = int.Parse(this.txtLegClimbs.Text);
            busObject.MasonTwists = int.Parse(this.txtMasonTwists.Text);

            //call method to save input data
            busObject.SaveData();

            //clear text boxes of data
            this.txtInAndOuts.Clear();
            this.txtForwardBicycles.Clear();
            this.txtReverseBicycles.Clear();
            this.txtCrunchyFrog.Clear();
            this.txtCrossLegWideLegSitups.Clear();
            this.txtFiferScissors.Clear();
            this.txtHipRockNRaise.Clear();
            this.txtPulseUpsHeelsToHeaven.Clear();
            this.txtVUpRollUpCombos.Clear();
            this.txtObliqueVUps.Clear();
            this.txtLegClimbs.Clear();
            this.txtMasonTwists.Clear();
    }

This is the code from my business object layer:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;
using System.Configuration;

namespace P90XProgram
{
    public class AbRipperXBOL
    {
        int inAndOuts = 0,
            forwardBicycles = 0,
            reverseBicycles = 0,
            crunchyFrog = 0,
            crossLegWideLegSitups = 0,
            fiferScissors = 0,
            hipRockNRaise = 0,
            pulseUpsHeelsToHeaven = 0,
            vUpRollUpCombos = 0,
            obliqueVUps = 0,
            legClimbs = 0,
            masonTwists = 0;

        OleDbConnection aConnection = 
            new OleDbConnection(
                "Provider=Microsoft.ACE.OLEDB.12.0;" +
                "Data Source=P90XDatabase.accdb;");       

        public AbRipperXBOL()
        {            
        }

        //property for inAndOuts variable
        public int InAndOuts
        {
            get { return inAndOuts; }
            set { inAndOuts = value; }
        }

        //property for forwardBicycles variable
        public int ForwardBicycles
        {
            get { return forwardBicycles; }
            set { forwardBicycles = value; }
        }

        //property for reverseBicycles variable
        public int ReverseBicycles
        {
            get { return reverseBicycles; }
            set { reverseBicycles = value; }
        }

        //property for crunchyFrog variable
        public int CrunchyFrog
        {
            get { return crunchyFrog; }
            set { crunchyFrog = value; }
        }

        //property for crossLegWideLegSitups variable
        public int CrossLegWideLegSitups
        {
            get { return crossLegWideLegSitups; }
            set { crossLegWideLegSitups = value; }
        }

        //property for fiferScissors variable
        public int FiferScissors
        {
            get { return fiferScissors; }
            set { fiferScissors = value; }
        }

        //property for hipRockNRaise variable
        public int HipRockNRaise
        {
            get { return hipRockNRaise; }
            set { hipRockNRaise = value; }
        }

        //property for pulseUpsHeelsToHeaven
        public int PulseUpsHeelsToHeaven
        {
            get { return pulseUpsHeelsToHeaven; }
            set { pulseUpsHeelsToHeaven = value; }
        }

        //property for vUpRollUpCombos variable
        public int VUpRollUpCombos
        {
            get { return vUpRollUpCombos; }
            set { vUpRollUpCombos = value; }
        }

        //property for obliqueVUps variable
        public int ObliqueVUps
        {
            get { return obliqueVUps; }
            set { obliqueVUps = value; }
        }

        //property for legClimbs variable
        public int LegClimbs
        {
            get { return legClimbs; }
            set { legClimbs = value; }
        }

        //property for masonTwists variable
        public int MasonTwists
        {
            get { return masonTwists; }
            set { masonTwists = value; }
        }

        public void InitializeConnection()
        {
            AbRipperXDAL.InitializeConnection(aConnection);
        } 

        public void SaveData()
        {
            AbRipperXDAL.SaveData(this);
        }        

        public static void BackToMainSchedule()
        {
            P90xScheduleForm f1;            

            if (Application.OpenForms["P90xScheduleForm"] == null)
            {
                f1 = new P90xScheduleForm();
                f1.Name = "P90xScheduleForm";
            }
            else
            {
                f1 = Application.OpenForms["P90xScheduleForm"] as P90xScheduleForm;
            }

            f1.Show();
        }
    }
}

This is the code from my data access layer:

using System;
using System.Collections.Generic;
using System.Collections;
using System.Text;
using System.Data;
using System.Data.OleDb;

namespace P90XProgram
{
    class AbRipperXDAL
    {
        static OleDbConnection aConnection = null;

        public static void InitializeConnection(OleDbConnection aDbConnection)
        {
            aConnection = aDbConnection;
            aConnection.Open();
        }

        public static void SaveData(AbRipperXBOL busObject)
        {
            try
            {
                String sSQLCommand = "INSERT INTO AbRipperX (InAndOuts, " +
                    "ForwardBicycles, ReverseBicycles, CrunchyFrog, " +
                    "CrossLegWideLegSitups, Fiferscissors, HipRockNRaise, " +
                    "PulseUpsHeelsToHeaven, VUpRollUpCombos, ObliqueVUps, " +
                    "LegClimbs, MasonTwists) VALUES ('" + busObject.InAndOuts +
                    "','" + busObject.ForwardBicycles + "','" + 
                    busObject.ReverseBicycles + "','" + busObject.CrunchyFrog +
                    "','" + busObject.CrossLegWideLegSitups + "','" + 
                    busObject.FiferScissors + "','" + busObject.HipRockNRaise +
                    "','" + busObject.PulseUpsHeelsToHeaven + "','" +
                    busObject.VUpRollUpCombos + "','" + busObject.ObliqueVUps +
                    "','" + busObject.LegClimbs + "','" + 
                    busObject.MasonTwists + "')"; 

                if (aConnection.State == ConnectionState.Closed)
                {
                    aConnection.Open();
                }

                OleDbCommand cmd = aConnection.CreateCommand();
                cmd.CommandText = sSQLCommand;
                // Execute the SQL command
                cmd.ExecuteNonQuery();
                aConnection.Close();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }                
        }        
    }
}
  • 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-02T05:24:46+00:00Added an answer on June 2, 2026 at 5:24 am

    Everything looks good! I would set a break point on your Console.WriteLine(ex.ToString()); and see if you are missing an exception

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

Sidebar

Related Questions

This may be a stupid question, but I have to ask! I have the
I'm new to ASP.NET MVC so this may be a stupid question. I have
I know this may be a stupid question to ask but I have really
This question may have been asked before, but I'm starting to get into game
This question may seem stupid, but, so be it! I have a stupid problem
This may seem like a stupid Question but i have two cubes being rendered
This may be a stupid question, as I'm not sure how MSBuild works with
This may be a stupid question but im just starting to learn Rail thats
this may be a stupid question but when I add a reference to my
This may be a stupid question to ask, but still I need to know

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.