posts - 22, comments - 5, trackbacks - 0, articles - 11

C#.NET REPLACE FUNCTION

Posted on 2008-07-25 17:24 疯狂水车 阅读(495) 评论(0)  编辑 收藏 引用 所属分类: 随想畅笔

e.g.

private void btnViewReport_Click(object sender, System.EventArgs e)
  {
   Session["Customer"] = txtCustID.Text;
   Session["custrefno"] = ReplaceEscapeChars(custreftxt.Text);
   Session["partno"] = partnotxt.Text;
   Session["good"] = goodtxt.Text;
   Session["RFormat"] = RFormat.SelectedValue;
   iFrReport.Visible = true;
  }

  public static string ReplaceEscapeChars(string str)
  {
   if (str == null)
    return str;

   if (str == "")
    return str;

   str = str.Replace("'", "''");
   return str;
  }

只有注册用户登录后才能发表评论。