最好用存储过程,不直接用SQL
解决方案 »
- WebResponse文件上传
- C#操作Excel,Microsoft Jet 数据库引擎打不开文件''问题
- GridView的输出问题
- C#如何使用Raw Socket发送TCP报文呢?
- socket异步通信方式下的文件传送问题!请各位帮忙!
- 一个SQL问题,高手救急啊...
- 如何修改hashtable中的键?
- 请问:如何在线播放avi视频文件,即刻解决,即刻给分
- C# \winform控件库
- 如何将某个Excel文件中的特定sheet复制到一个另一个Excel文件中去?
- 很多次都没解决动态生成的DropDownList控件,SelectItemValue 的值的问题!
- 如何用OleDbCommand创建一个Access数据库
{
StringBuilder retVal = new StringBuilder();
// check incoming parameters for null or blank string
if ((inputString != null) && (inputString != String.Empty))
{
inputString = inputString.Trim(); //chop the string incase the client-side max length
//fields are bypassed to prevent buffer over-runs
if (inputString.Length > maxLength)
inputString = inputString.Substring(0, maxLength); //convert some harmful symbols incase the regular
//expression validators are changed
for (int i = 0; i < inputString.Length; i++)
{
switch (inputString[i])
{
case '"':
retVal.Append(""");
break;
case '<':
retVal.Append("<");
break;
case '>':
retVal.Append(">");
break;
default:
retVal.Append(inputString[i]);
break;
}
} // Replace single quotes with white space
retVal.Replace("'", " ");
}
return retVal.ToString();
}