zoukankan      html  css  js  c++  java
  • sqlParameter的两种写法 以及存储过程还有sql语句(防注入)

    SqlParamerter sp=new SqlParamerter[]{
    new SqlParamerter("@id",id)
    }

      

    SqlParameter[] sp = new SqlParameter[1];
    sp[0] = new SqlParameter("@name", name);

      -------------------------------------------------------------------------------

     public static object queryName(string name)
    {
    SqlParameter[] sp
    = new SqlParameter[1];
    sp[
    0] = new SqlParameter("@name", name);
    CommandType ct
    = CommandType.Text;
    return Sqlhelper.ExecuteScalar("select programid from program where programname=@name", sp, ct);
    }

      

    public static int savaIdea(string idea, int proid, int ndid)
    {
    SqlParameter[] sp
    = new SqlParameter[3];
    sp[
    0] = new SqlParameter("@idea", idea);
    sp[
    1] = new SqlParameter("@proid", proid);
    sp[
    2] = new SqlParameter("@ndid", ndid);
    CommandType ct
    = CommandType.StoredProcedure;
    return Sqlhelper.ExecuteNonQuery("proc_saveIdea", sp, ct);
    }

      

  • 相关阅读:
    js原型杂谈
    arguments.callee.caller
    $resource
    sql的四种匹配模式
    AMD规范
    module.ngdoc
    angularjs杂谈
    浏览器前缀
    css21规范学习
    <meta>标签
  • 原文地址:https://www.cnblogs.com/0banana0/p/2157324.html
Copyright © 2011-2022 走看看