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
Jaspreet Kaur
NA
7
3.1k
please trace an error in the following code?
Jun 21 2012 6:42 AM
please help,, this particular code has become headache for me!!! i coudnt get it " where m i wrong???please trace an error in the following code. this is simple code to update data,, i dont know y it is giving "Syntax error in UPDATE statement."
OleDbConnection con = new OleDbConnection();
con.ConnectionString = connection.connstring;
con.Open();
OleDbCommand cmd = new OleDbCommand();
cmd.CommandText ="update info set city=@a,cname=@b,contactno=@c,add=@d,pincode=@e where fname='" + comboBox1.Text + "'";
cmd.Connection = con;
cmd.Parameters.AddWithValue("@a", comboBox2.Text);
cmd.Parameters.AddWithValue("@b", textBox1.Text);
cmd.Parameters.AddWithValue("@c", textBox2.Text);
cmd.Parameters.AddWithValue("@d", richTextBox1.Text);
cmd.Parameters.AddWithValue("@e", textBox3.Text);
int i = cmd.ExecuteNonQuery();
if (i > 0)
{
MessageBox.Show("data is updated");
}
thanks in advance!!
Reply
Answers (
2
)
How to set in advance the Number of copies for a specific report?
combobox