zoukankan      html  css  js  c++  java
  • DataReader调用

                

    调用方法:

    using (IDataReader dr = DbHelper.ExecuteReader(strSql))
                {
                    while (dr.Read())
                    {
                       //    赋值           

                    }
                    dr.Close();
                }

    公共方法:

            public static IDataReader ExecuteReader(string strSql)
            {
                SqlConnection con = new SqlConnection(connectionString);
                SqlCommand command = new SqlCommand(strSql, con);
                con.Open();
                SqlDataReader reader = command.ExecuteReader();
                return reader;
            }

  • 相关阅读:
    每种特定的迭代器如何使用
    常量迭代器
    容器迭代器
    三十分钟掌握STL
    高快省的排序算法
    FloatTest32 Example
    /浮点数的比较
    java第一天
    ACwing 898
    POJ 3268
  • 原文地址:https://www.cnblogs.com/swarb/p/9924438.html
Copyright © 2011-2022 走看看