zoukankan      html  css  js  c++  java
  • .net读取数据库分页方法汇总

            /// <summary>
            /// .net自带分页方法
            /// </summary>
            /// <param name="PageSize"></param>
            /// <param name="PageIndex"></param>
            /// <param name="strWhere"></param>
            /// <returns></returns>
            public static DataSet RunProcedure(int PageSize, int PageIndex, string strWhere)
            {
                using (SqlConnection connection = new SqlConnection(connectionString))
                {
                    DataSet ds = new DataSet();
                    try
                    {
                        connection.Open();
                        SqlDataAdapter command = new SqlDataAdapter(strWhere, connection);
                        command.Fill(ds, PageIndex, PageSize, strWhere);
                    }
                    catch (System.Data.SqlClient.SqlException ex)
                    {
                        throw new Exception(ex.Message);
                    }
                    return ds;
                }
            }





  • 相关阅读:
    敏捷软件开发实践-Code Review Process(转)
    随笔1
    随笔
    随笔
    低级错误
    随笔
    随笔2
    随笔
    这以前写的代码
    蛋疼的vs
  • 原文地址:https://www.cnblogs.com/xyzhuzhou/p/2995544.html
Copyright © 2011-2022 走看看