public static string CDBStr(string str, bool bIsUnicode) { string strRet = ""; if (str.Length == 0) { return "''"; } else { strRet = "'" + str.Replace("'", "''") + "'"; if (bIsUnicode) { strRet = "N" + strRet; } return strRet; } }
Coding is one of my job from 2001. I have written codes for many projects but I cannot remember all of them. I hope this blog help me do that.