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
I am getting error in update statement
Jun 13 2012 3:39 PM
OleDbConnection con = new OleDbConnection();
con.ConnectionString = connection.connstring;
con.Open();
OleDbCommand cmd = new OleDbCommand();
cmd.CommandText="update info set fname=@a,lname=@b,cname=@c,add=@d,contactno=@e,city=@f,pincode=@g where ID='" + textBox2.Text + "'";
cmd.Connection = con;
cmd.Parameters.AddWithValue("@a", textBox1.Text);
cmd.Parameters.AddWithValue("@b", textBox3.Text);
cmd.Parameters.AddWithValue("@c", textBox4.Text);
cmd.Parameters.AddWithValue("@d", richTextBox1.Text);
cmd.Parameters.AddWithValue("@e", textBox5.Text);
cmd.Parameters.AddWithValue("@f", textBox6.Text);
cmd.Parameters.AddWithValue("@g", textBox7.Text);
int i = cmd.ExecuteNonQuery();
if (i > 0)
{
MessageBox.Show("Data is updated");
}
Reply
Answers (
1
)
I want to create an install using vs2010 for c# applications. also installing SQL Express 2012
Short key for ordering the code lines in C#.NET