Tag Archives: SQL

Be careful with CASE and NULL statement

Checking NULL values in database can be a little tricky. It is very easy to trickle those if you do not provide correct syntax. The recommend way to check null is ISNULL(myfieldname,”). When using NULL in case statement, it might … Continue reading

Posted in Tutorials/Tips | Tagged , , | Leave a comment

executenonquery returns -1 on success

ExecuteNonQuery is suppose to return the number of rows inserted, updated or deleted but in my case it always return -1 even though the record is successfully added. Found out SET NOCOUNT OFF was missing my in my stored procedure. … Continue reading

Posted in Tutorials/Tips | Tagged , , , , , | Leave a comment