Note that there are some explanatory texts on larger screens.

plurals
  1. POError in update function for CRUD in Windows Form
    primarykey
    data
    text
    <p>Am new to programming, so please assist as much as possible! Recently, im tasked to do a CRUD windows form application using C# &amp; MS access.</p> <p>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.</p> <p>Error: <code>ArgumentException</code> was unhandled</p> <blockquote> <p>Input string was not in a correct format.Couldn't store in staff_id Column. Expected type is Int32.</p> </blockquote> <p>Here is my code:</p> <pre><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); } } } </code></pre> <p>Appreciated for help and explanation thankyou.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload