7 Replies - 361 Views - Last Post: 10 December 2018 - 02:43 PM Rate Topic: *---- 1 Votes

#1 rizsoomro   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 72
  • Joined: 26-January 18

update statement (0x80040E14) in C# in access database

Posted 07 December 2018 - 10:55 AM

i have erro 0x80040e14 in Access database in c#



private void btnUpdate_Click(object sender, EventArgs e)
		{
			double c = Convert.ToDouble(txtCNIC.Text);
			double m = Convert.ToDouble(txtMobile.Text);
			double t = Convert.ToDouble(txtResTel.Text);

			try
			{
				if (MetroMessageBox.Show(this, "Are you sure you want to update this record?", "MAARS Software", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
				{
					{
						// Update Data in Booking Table
						OleDbDataAdapter da = new OleDbDataAdapter("update [Booking] set NameApplicant='" + txtName.Text + "', FatherName='" + txtFName.Text + "', [Occupation]='" + txtOccupation.Text + "', MonthlyIncome=" + txtMonthlyIncome.Text + ", CNICNo=" + c + ", ApplicantAge='" + txtAAge.Text + "', ApplicantAddress='" + txtAddres.Text + "', MobileNo=" + m + ", ResidenceTel=" + t + ", EmailID='" + txtEmail.Text + "', NoOfDependents='" + txtNoOfDep.Text + "', [Nominee]='" + txtNominee.Text + "', ModifiedBy='" + lblLoginID.Text + "', ModiUserType='" + lblUserType.Text + "', ModifiedDate='" + datepicker.Value.Date.ToString() + "' where FormCode=" + txtFormCode.Text + " ", conn);
						DataSet ds = new DataSet();
						da.Fill(ds);
					}
					{
						// Update Data in Payment Table
						OleDbDataAdapter da = new OleDbDataAdapter("update [Payment] set NameApplicant='" + txtName.Text + "', FatherName='" + txtFName.Text + "', CNICNo=" + c + ", ApplicantAddress='" + txtAddres.Text + "', MobileNo=" + m + ", ResidenceTel=" + t + ", EmailID='" + txtEmail.Text + "', ModifiedBy='" + lblLoginID.Text + "', ModiUserType='" + lblUserType.Text + "', ModifiedDate='" + datepicker.Value.Date.ToString() + "' where FormCode=" + txtFormCode.Text + " ", conn);
						DataSet ds = new DataSet();
						da.Fill(ds);
						
					}
					ViewData();
					ClearAllCInfo();
					MetroMessageBox.Show(this, "User Data updated successfully", "MAARS Software", MessageBoxButtons.OK, MessageBoxIcon.Information);
					NewAppID();
				}

				else
				{

				}
			}
			catch (Exception ex)
			{
				MetroFramework.MetroMessageBox.Show(this, "Error" + ex.Message, "Stop", MessageBoxButtons.OK, MessageBoxIcon.Stop);
			}
		}



Is This A Good Question/Topic? 0
  • +

Replies To: update statement (0x80040E14) in C# in access database

#2 modi123_1   User is offline

  • Suitor #2
  • member icon



Reputation: 15270
  • View blog
  • Posts: 61,223
  • Joined: 12-June 08

Re: update statement (0x80040E14) in C# in access database

Posted 07 December 2018 - 11:03 AM

Please copy/paste the entire error message. It may, you know, narrow down which line it is coming from. :^:

Also use parameters.

https://docs.microso...framework-4.7.2
Was This Post Helpful? 1
  • +
  • -

#3 Skydiver   User is online

  • Code herder
  • member icon

Reputation: 7056
  • View blog
  • Posts: 24,003
  • Joined: 05-May 12

Re: update statement (0x80040E14) in C# in access database

Posted 07 December 2018 - 12:01 PM

In your other thread, you said you change CNICNo into a string. You seem to be back to using a double once more. *sigh*

And as I recall there was another thread where we told you that storing phone numbers as numeric values is also a bad idea.
Was This Post Helpful? 1
  • +
  • -

#4 Skydiver   User is online

  • Code herder
  • member icon

Reputation: 7056
  • View blog
  • Posts: 24,003
  • Joined: 05-May 12

Re: update statement (0x80040E14) in C# in access database

Posted 07 December 2018 - 03:01 PM

OMG!

And look! Age, which is something that should be numeric value, is stored as a string:
... + ", ApplicantAge='" + txtAAge.Text + "', ApplicantAddress='" + ...


Was This Post Helpful? 0
  • +
  • -

#5 Sheepings   User is offline

  • D.I.C Lover
  • member icon

Reputation: 224
  • View blog
  • Posts: 1,260
  • Joined: 05-December 13

Re: update statement (0x80040E14) in C# in access database

Posted 07 December 2018 - 03:47 PM

My number one pet-hate, asking for help, and then ignoring everything you were ever advised...
Was This Post Helpful? 0
  • +
  • -

#6 Sheepings   User is offline

  • D.I.C Lover
  • member icon

Reputation: 224
  • View blog
  • Posts: 1,260
  • Joined: 05-December 13

Re: update statement (0x80040E14) in C# in access database

Posted 07 December 2018 - 03:53 PM

Why are C,M,T doubles? :blink:

Why are you not using parameters?

You do know you're doing everything the complicated and impractical way?
Was This Post Helpful? 0
  • +
  • -

#7 JapanDave   User is offline

  • D.I.C Regular

Reputation: 35
  • View blog
  • Posts: 413
  • Joined: 01-February 16

Re: update statement (0x80040E14) in C# in access database

Posted 09 December 2018 - 07:48 PM

And to post one more thing, I would try and stay away from Access DataBase, I have only ever had trouble with them. SQL Server is free and is 100 times more robust. If you can, I would start again with SQL Server.
Was This Post Helpful? 1
  • +
  • -

#8 TechnoBear   User is offline

  • Lady A
  • member icon

Reputation: 462
  • View blog
  • Posts: 1,398
  • Joined: 02-November 11

Re: update statement (0x80040E14) in C# in access database

Posted 10 December 2018 - 02:43 PM

View PostJapanDave, on 09 December 2018 - 08:48 PM, said:

If you can, I would start again with SQL Server.


Given the fact it basically needs to be completely re-written anyway, I think they could :P
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1