I have very strange situation with SQL update query.
This si query I used in many project but in last does not works.
“UPDATE studydelete SET stat=1 WHERE StudyID= '”+txtStudyID+“'”
I don’t get any error or anything else, just don’t want to update datatable. ???
I was tried all variation and nothing works.
StudyID variable is a string in format “03/12/2013” or “DTE124565”.
When I replaced txtStudyID with “03/12/2013” then UPDATE works.
I don’t know what is wrong but it is a very strange situation.
Well it could be because of datatype mismatch between the variable mentioned and the table column type
Or
Sometimes the variable doesn’t hold any value
Check with log message before to this query activity and see the value of that variable whether it has or not
But to work with query, try something like this
"UPDATE studydelete SET stat = 1 WHERE StudyID = ' " + txtStudyID + " ' "
Or
Like this with a parameter passed to the query
"UPDATE studydelete SET stat = 1 WHERE StudyID = @StudyID"
Here studyID you can pass the value by creating IN argument in that query activity