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
Mohammed Salim
NA
56
3.5k
Update Command not working
Apr 19 2018 2:50 PM
Thanks for the help in advance.
Im trying to use update query in C#
command is getting executed even if I use incorrect values is given.
Instead giving error . It shows command successful.
Pls find the code
protected
void
Button1_Click(
object
sender, EventArgs e)
{
try
{
con.Open();
cmd =
new
SqlCommand(
"update Comcast_AvayaID set Status='Inactive' where Employee_Id='"
+ TxtEMPID.Text +
"' and AvayaID ='"
+ TxtAvayaID.Text +
"'"
, con);
cmd =
new
SqlCommand(
"UPDATE Avaya_Id SET Status = 'UnAssigned' where Avaya_ID ='"
+ TxtAvayaID.Text +
"'"
, con);
cmd.ExecuteNonQuery();
LBLSuccess.Visible =
true
;
LBLSuccess.Text =
"Deactivation Successfull"
;
con.Close();
}
catch
(SqlException ex)
{
LBLSuccess.Visible =
true
;
LBLSuccess.Text =
"Deactivation Unsuccessfull"
;
}
Reply
Answers (
1
)
Conect manualy from MS sql to datagrid?
Sum for column from multiple tables ms sql