zoukankan      html  css  js  c++  java
  • asp.net api后台

    public string sqlstr = ConfigurationManager.ConnectionStrings["LIANJIE"].ConnectionString;
    DBhelper db = new DBhelper();
    //存储过程显示
    public DataTable DateShow(string TableName,string WhereName,string OrderBy,int PageIndex,int PageSize, out int PageCount )
    {
    SqlParameter[] parameters = new SqlParameter[] {
    new SqlParameter(){ ParameterName="tableNanme",SqlDbType= SqlDbType.Text,Value=TableName},
    new SqlParameter(){ ParameterName="whereName",SqlDbType= SqlDbType.Text,Value=WhereName},
    new SqlParameter(){ ParameterName="orderBy",SqlDbType= SqlDbType.Text,Value=OrderBy},
    new SqlParameter(){ ParameterName="pageIndex",SqlDbType= SqlDbType.Int,Value=PageIndex},
    new SqlParameter(){ ParameterName="pageSize",SqlDbType= SqlDbType.Int,Value=PageSize},
    new SqlParameter(){ ParameterName="pageCount",SqlDbType= SqlDbType.Int,Direction= ParameterDirection.Output},
    };
    using (SqlConnection con=new SqlConnection(sqlstr))
    {
    con.Open();
    using (SqlCommand com = new SqlCommand("pageStu",con))
    {
    com.CommandType = CommandType.StoredProcedure;
    com.Parameters.AddRange(parameters);
    SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(com);
    DataTable tb = new DataTable();
    sqlDataAdapter.Fill(tb);
    PageCount = Convert.ToInt32( parameters[5].Value);
    return tb;
    }
    }
    }

  • 相关阅读:
    传球接力
    业务办理
    P2077 红绿灯
    【UR #4】元旦激光炮
    P1939 【模板】矩阵加速(数列)
    #82. 【UR #7】水题生成器
    Visible Trees HDU
    创始人的领导力和合伙人选择
    面向对象笔试题练习一
    MicroPython+北斗+GPS+GPRS:TPYBoardv702短信功能使用说明
  • 原文地址:https://www.cnblogs.com/kongjie/p/13083234.html
Copyright © 2011-2022 走看看