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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:17:22+00:00 2026-06-17T08:17:22+00:00

Am new to programming, so please assist as much as possible! Recently, im tasked

  • 0

Am new to programming, so please assist as much as possible!
Recently, im tasked to do a CRUD windows form application using C# & MS access.

In my update function, i face one of the following errors which im not sure why..
My data are not able to be updated either.

Error: ArgumentException was unhandled

Input string was not in a correct format.Couldn’t store
in staff_id Column. Expected type is
Int32.

Here is my code:

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 AcuzioSapp.AcuzioSecureStore_DatabaseDataSetTableAdapters;

namespace AcuzioSapp
{
    public partial class Update_Client : Form
    {
        private DataRow row;
        private ClientTableAdapter adapter;
        public Update_Client(DataRow row, ClientTableAdapter adapter)
        {
            InitializeComponent();
            this.row = row;
            this.adapter = adapter;
            textBox_id1.Text = Convert.ToString(row["c_id"]);
            textBox_name1.Text = Convert.ToString(row["c_name"]);
            textBox_address1.Text = Convert.ToString(row["c_address"]);
            textBox_cinfo1.Text = Convert.ToString(row["c_contactinfo"]);
            textBox_pinfo1.Text = Convert.ToString(row["profile_info"]);
            textBox_refno1.Text = Convert.ToString(row["c_8digitrefno"]);
            textBox_staffid1.Text = Convert.ToString(row["staff_id"]);
        }

        private void button_close_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void button_update_Click(object sender, EventArgs e)
        {
            row["c_name"] = "textBox_name1";
            row["c_address"] = "textBox_address1";
            row["c_contactinfo"] = "int.Parse(textBox_cinfo1)";
            row["c_8digitrefno"] = "(textBox_pinfo1)";
            row["profile_info"] = "textBox_refno1";
            row["staff_id"] = "int.Parse(textBox_staffid1)";

            adapter.Update(row);
        }
    }
}

Appreciated for help and explanation thankyou.

  • 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-17T08:17:22+00:00Added an answer on June 17, 2026 at 8:17 am

    Thats because of your column is declared integer in your Access database and you try to insert a String value in it. And I also think you will not get proper value in your specified table because you update your columns by constant string (row["profile_info"] = "textBox_refno1";), this will insert textBox_refno1 into profile_info column not TextBox value.
    Try this :

    row["staff_id"] = Convert.ToInt32(textBox_staffid1.Text);
    

    Update:
    Copy and paste following code, and you will never have any issue:

        private void button_update_Click(object sender, EventArgs e)
        {
            row["c_name"] = textBox_name1.Text;
            row["c_address"] = textBox_address1.Text;
            row["c_contactinfo"] = int.Parse(textBox_cinfo1.Text);
            row["c_8digitrefno"] = textBox_pinfo1.Text;
            row["profile_info"] = textBox_refno1.Text;
            row["staff_id"] = int.Parse(textBox_staffid1.Text);
    
            adapter.Update(row);
    
            MessageBox.Show("Data has been updated");
        }
    

    Hope this help.

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

Sidebar

Related Questions

I'm new to programming and rails so please forgive any big oversights. I recently
First, i should say that I am relatively new to programming so please be
I am new to programming in general so please keep that in mind when
I am quite new to programming, i have a question please help me. (
I'm really new to programming, so I'm having trouble explaining this -- please forgive.
I'm new in C++ programming, so please don't be too harsh now :) .
I'm new to the world of Mac programming. Can someone please tell me what
Please bear with me as I am new to dojo, javascript, and web programming
I'm new in programming so please don't kill me for asking stupid questions. I've
I am a brand new programming student, so please forgive my ignorance. My assignment

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.