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
d kris
NA
4
0
syntax error in update statement
Apr 14 2010 5:52 AM
Hello,
I have been trying desperately to resolve the problem but to no avail... An oledb exception "syntax error in update statement is encountered...I have checked for everything possible including reserved keywords (the Amt_Paid? column is thus put in brackets )...
please help ....any help would be appreciated....Here's the code:
DialogResult result=MessageBox.Show("Do you want to check payment details again?","Verify before Proceeding",MessageBoxButtons.YesNo);
string amntpd = "Yes";
string cnstrcl;
if (result == DialogResult.No)
{
cnstrcl = ConfigurationManager.ConnectionStrings["WindowsFormsApplication3.Properties.Settings.ClienteleConnectionString"].ConnectionString;
OleDbConnection cl = new OleDbConnection();
cl.ConnectionString = cnstrcl;
cl.Open();
string uppay = string.Format("update Invoice set [Amt_Paid?] like '{0}',Cheque_No='{1}',Cheque_Date like '{2}',Bank_Withdrawn='{3}',Bank_Deposited='{4}' where Bill_No='{5}'",amntpd.Trim(),txtCheNo.Text, dtCheDate.Value, txtbankwith.Text, cmbbankdep.SelectedItem.ToString(), cmbinvoice.SelectedValue.ToString());
using (OleDbCommand cmd = new OleDbCommand(uppay, cl))
{
cmd.ExecuteNonQuery();
}
cl.Close();
MessageBox.Show("Updated Successfully");
Reply
Answers (
1
)
How to select and view pdf, word files from a location on a hard disk.
transfering data from one gridview to another page gridview