Tech
Forums
Jobs
Books
Events
Videos
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
3
Answers
Update to MSSQL database failed.
Cris Abella
10y
1.1k
1
Reply
Hello everybody please consider me as a newbie in C# and I am much willing to learn this language. This is first time I've join the community.
why update to mssql database failed.
mssql table
custId = int(autoincrement)
custname = varchar(30)
SqlConnection con = new SqlConnection("Data Source=CRIS-PC\\SQLEXPRESS;Integrated Security=True;Initial Catalog = POS");
SqlCommand command = new SqlCommand("Update customers set custname = @custname where custid = @custId)", con);
command.Parameters.AddWithValue("@custname",txtName.Text);
command.Parameters.AddWithValue("@custId",Convert.ToInt32(txtCustId.Text));
thank in advance.
Cris
Post
Reset
Cancel
Answers (
3
)
Next Recommended Forum
Data is inserted in database before submit button
How do i hide sub menu items of toolstrip