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
Chidiebere Mgbemena
NA
179
14.2k
Error in updating products on datagridview c#
Apr 17 2020 4:08 PM
I got this error below while trying to update product table:
Unclosed quotation mark after the character string " where ProID=''. Incorrect syntax near "where ProID =''.
My codes:
private
void
btnUpdate_Click(
object
sender, EventArgs e)
{
try
{
con.Open();
cmd =
new
SqlCommand(
"UPDATE tbl_Products SET ProName='"
+txtProName.Text+
"' where ProID='"
+txtProID.Text+
"' "
, con);
cmd.ExecuteNonQuery();
con.Close();
MessageBox.Show(
"Product Info Saved..."
);
fillGrid();
cleartext();
}
catch
(Exception ex)
{
MessageBox.Show(ex.Message);
}
con.Close();
{
}
}
private
void
cleartext()
{
txtProID.Text =
""
;
txtProName.Text =
"'"
;
}
}
}
Please help me find the unclosed quotation
thanks
Reply
Answers (
2
)
Extract similar data from text file as input in the textbox
CryptoJS Encryption and Decryption in UWP C#