TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Rizwan Ahmed
NA
80
13.2k
update Error 0x80040E07 Access Database in c#
Dec 7 2018 12:45 PM
i create c# project with Access Database but on update (0x80040E07): Data type mismatch in criteria expression, code are as under;
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,
"Stop"
, MessageBoxButtons.OK, MessageBoxIcon.Stop);
}
}
Reply
Answers (
2
)
Element placeholder Selenium c#
telecommuting work