当前位置: 首页>>代码示例>>C#>>正文


C# SqlHelper.ExecuteReader方法代码示例

本文整理汇总了C#中SqlHelper.ExecuteReader方法的典型用法代码示例。如果您正苦于以下问题:C# SqlHelper.ExecuteReader方法的具体用法?C# SqlHelper.ExecuteReader怎么用?C# SqlHelper.ExecuteReader使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SqlHelper的用法示例。


在下文中一共展示了SqlHelper.ExecuteReader方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetReview

       public IList<ReviewInfo> GetReview(ReviewType rt, int ID)
       {
           SqlHelper objSqlHelper = new SqlHelper();
           List<ReviewInfo> reviews = new List<ReviewInfo>();
           SqlParameter[] objParams = new SqlParameter[2];
           objParams[0] = new SqlParameter("@reviewType", SqlDbType.Int, 4);
           objParams[1] = new SqlParameter("@ID", SqlDbType.Int, 4);
           objParams[0].Value = (int)rt;
           objParams[1].Value = ID;
           SqlDataReader reader = objSqlHelper.ExecuteReader("je_Reviews_GetReview", objParams);
           while (reader.Read())
           {
               ReviewInfo item = new ReviewInfo();
               item.ReviewID = reader.GetInt32(reader.GetOrdinal("ReviewID"));
               item.BookID = reader.GetInt32(reader.GetOrdinal("bookID"));
               item.PostIP = reader.GetString(reader.GetOrdinal("postIP"));
               item.PostTime = reader.GetDateTime(reader.GetOrdinal("postTime"));
               item.RateID = reader.GetInt32(reader.GetOrdinal("rate"));
               item.UserName = reader.GetString(reader.GetOrdinal("userName"));
               item.StatusID = reader.GetInt32(reader.GetOrdinal("status"));
               item.Content = reader.GetString(reader.GetOrdinal("content"));
               reviews.Add(item);
           }
           reader.Close();

           return reviews;
       }
开发者ID:cathychen00,项目名称:003.DianZiShangWu,代码行数:27,代码来源:Review.cs

示例2: GetAddressByID

        public AddressInfo GetAddressByID()
        {
            SqlHelper objSqlHelper = new SqlHelper();
            SqlParameter[] objParams = new SqlParameter[1];
            objParams[0] = new SqlParameter("@userName", SqlDbType.VarChar);

            objParams[0].Value = GetUserName();
            SqlDataReader reader = objSqlHelper.ExecuteReader("je_Ad_GetAddressByID", objParams);
            AddressInfo item = new AddressInfo();
            while (reader.Read())
            {
                item.UserName = reader.GetString(reader.GetOrdinal("userName"));
                item.AddressName = reader.GetString(reader.GetOrdinal("addressName"));
                item.Address = reader.GetString(reader.GetOrdinal("address"));
                item.Post = reader.GetString(reader.GetOrdinal("Post"));
                item.Telephone = reader.GetString(reader.GetOrdinal("Telephone"));
                item.Province = reader.GetString(reader.GetOrdinal("Province"));
                item.City = reader.GetString(reader.GetOrdinal("City"));
                item.SendType = reader.GetInt32(reader.GetOrdinal("SendType"));
                item.PayType = reader.GetInt32(reader.GetOrdinal("PayType"));
                item.Name = reader.GetString(reader.GetOrdinal("Name"));
                item.Price = reader.GetDecimal(reader.GetOrdinal("Price"));
                item.Balance = reader.GetDecimal(reader.GetOrdinal("Balance"));
            }
            reader.Close();
            return item;
        }
开发者ID:cathychen00,项目名称:003.DianZiShangWu,代码行数:27,代码来源:Address.cs

示例3: GetLinks

        public IList<FriendLinkInfo> GetLinks(LinkItemType linkType)
        {
            SqlHelper objSqlHelper = new SqlHelper();
            List<FriendLinkInfo> friendlinks = new List<FriendLinkInfo>();
            SqlParameter[] objParams = new SqlParameter[1];
            objParams[0] = new SqlParameter("@linkType", SqlDbType.Int, 4);
            objParams[0].Value = (int)linkType;
            SqlDataReader reader = objSqlHelper.ExecuteReader("je_Link_GetLinks", objParams); ;

            objParams[0].Value = (int)linkType;

            while (reader.Read())
            {
                FriendLinkInfo item = new FriendLinkInfo();
                item.LinkID = reader.GetInt32(reader.GetOrdinal("linkID"));
                item.LinkName = reader.GetString(reader.GetOrdinal("linkName"));
                item.LinkURL = reader.GetString(reader.GetOrdinal("linkURL"));
                item.LinkLogo = reader.GetString(reader.GetOrdinal("linkLogo"));
                item.LinkOrder = reader.GetInt32(reader.GetOrdinal("linkOrder"));
                item.IsMain = reader.GetBoolean(reader.GetOrdinal("linkMain"));
                item.IsArrow = reader.GetBoolean(reader.GetOrdinal("linkArrow"));
                friendlinks.Add(item);
            }
            reader.Close();
            return friendlinks;
        }
开发者ID:cathychen00,项目名称:003.DianZiShangWu,代码行数:26,代码来源:FriendLink.cs

示例4: GetAddress

 public IList<AddressInfo> GetAddress(int userID)
 {
     SqlHelper objSqlHelper = new SqlHelper();
     List<AddressInfo> Addresss = new List<AddressInfo>();
     SqlParameter[] objParams = new SqlParameter[1];
     objParams[0] = new SqlParameter("@userID", SqlDbType.Int, 4);
     objParams[0].Value = userID;
     SqlDataReader reader = objSqlHelper.ExecuteReader("je_Ad_GetAddress", objParams);
     while (reader.Read())
     {
         AddressInfo item = new AddressInfo();
         item.AddressID = reader.GetInt32(reader.GetOrdinal("addressID"));
         item.AddressName = reader.GetString(reader.GetOrdinal("addressName"));
         item.Address = reader.GetString(reader.GetOrdinal("address"));
         item.Post = reader.GetString(reader.GetOrdinal("Post"));
         item.Telephone = reader.GetString(reader.GetOrdinal("Telephone"));
         item.IsDefault = reader.GetBoolean(reader.GetOrdinal("isDefault"));
         item.Province = reader.GetString(reader.GetOrdinal("Province"));
         item.City = reader.GetString(reader.GetOrdinal("City"));
         item.SendType = reader.GetInt32(reader.GetOrdinal("SendType"));
         item.Name = reader.GetString(reader.GetOrdinal("Name"));
         Addresss.Add(item);
     }
     reader.Close();
     return Addresss;
 }
开发者ID:cathychen00,项目名称:003.DianZiShangWu,代码行数:26,代码来源:Address.cs

示例5: GetCategory

       public IList<CategoryInfo> GetCategory(CategoryType categoryType, int categoryID)
       {
           SqlHelper objSqlHelper = new SqlHelper();
           
           List<CategoryInfo> categorys = new List<CategoryInfo>();
           SqlParameter[] objParams = new SqlParameter[2];
           objParams[0] = new SqlParameter("@categoryType", SqlDbType.Int, 4);
           objParams[1] = new SqlParameter("@categoryID", SqlDbType.Int, 4);
           objParams[0].Value = (int)categoryType;
           objParams[1].Value = categoryID;

           SqlDataReader reader = objSqlHelper.ExecuteReader("je_Cat_GetCategory", objParams); ;
           while (reader.Read())
           {
               
               CategoryInfo item = new CategoryInfo();
               item.CategoryID = reader.GetInt32(reader.GetOrdinal("categoryID"));
               item.CategoryName = reader.GetString(reader.GetOrdinal("categoryName"));
               item.ParentID = reader.GetInt32(reader.GetOrdinal("parentID"));
               item.IsMain = reader.GetBoolean(reader.GetOrdinal("IsMain"));
               categorys.Add(item);
           }
           reader.Close();
           objSqlHelper.close();
           
           return categorys;
       }
开发者ID:cathychen00,项目名称:003.DianZiShangWu,代码行数:27,代码来源:Category.cs

示例6: GetBookByID

 public BookInfo GetBookByID(int bookID)
 {
     SqlHelper objSqlHelper = new SqlHelper();
     List<BookInfo> books = new List<BookInfo>();
     SqlParameter[] objParams = new SqlParameter[1];
     objParams[0] = new SqlParameter("@bookID", SqlDbType.Int, 4);
     objParams[0].Value = bookID;
     SqlDataReader reader = objSqlHelper.ExecuteReader("je_Book_GetBookByID", objParams);
     BookInfo item = new BookInfo();
     while (reader.Read())
     {
         //图书编号
         item.BookID = reader.GetInt32(reader.GetOrdinal("BookID"));
         //图书名字,分类,价格,会员价格,大图,小图
         item.BookName = reader.GetString(reader.GetOrdinal("BookName"));
         item.Category = reader.GetInt32(reader.GetOrdinal("bookCategory"));
         item.Price = reader.GetDecimal(reader.GetOrdinal("bookPrice"));
         item.MemberPrice = reader.GetDecimal(reader.GetOrdinal("bookMemberPrice"));
         item.BookPublish = reader.GetString(reader.GetOrdinal("BookPublish"));
         item.BookImage = reader.GetString(reader.GetOrdinal("BookImage"));
         item.BookSmallImage = reader.GetString(reader.GetOrdinal("bookSmallImage"));
         //是否发布,是否推荐,是否特价,是否热卖,是否允许评论,库存数量
         item.IsRelease = reader.GetBoolean(reader.GetOrdinal("isRelease"));
         item.IsGood = reader.GetBoolean(reader.GetOrdinal("isGood"));
         item.IsCheap = reader.GetBoolean(reader.GetOrdinal("isCheap"));
         item.IsSaleGood = reader.GetBoolean(reader.GetOrdinal("isSaleGood"));
         item.ReviewEnable = reader.GetBoolean(reader.GetOrdinal("reviewEnable"));
         item.Stock = reader.GetInt32(reader.GetOrdinal("bookStock"));
         //图书简介,作者,出版时间,国际编号,出版社,页数,版次
         item.SmallBookDec = reader.GetString(reader.GetOrdinal("smallBookDesc"));
         item.BookAuthor = reader.GetString(reader.GetOrdinal("bookAuthor"));
         item.PublishTime = reader.GetDateTime(reader.GetOrdinal("bookPublishTime"));
         item.BookISBN = reader.GetString(reader.GetOrdinal("bookISBN"));
         item.BookPublish = reader.GetString(reader.GetOrdinal("bookPublish"));
         item.BookPages = reader.GetInt32(reader.GetOrdinal("bookPages"));
         item.BookEditions = reader.GetString(reader.GetOrdinal("bookEditions"));
         //是否为期书,搜索关键字,加入时间,具体介绍
         item.IsExpect = reader.GetBoolean(reader.GetOrdinal("isExpect"));
         item.SearchKey = reader.GetString(reader.GetOrdinal("searchKey"));
         item.BookDec = reader.GetString(reader.GetOrdinal("BookDec"));
         item.ReadCount = reader.GetInt32(reader.GetOrdinal("bookReadCount"));
         item.ReviewCount = reader.GetInt32(reader.GetOrdinal("bookCommentCount"));
         //
         item.TeacherID = reader.GetInt32(reader.GetOrdinal("TeacherID"));
         item.CatenaID = reader.GetInt32(reader.GetOrdinal("CatenaID"));
         item.Rate = reader.GetDecimal(reader.GetOrdinal("bookRate"));
         //折扣,团队折扣,团队价格
         item.Rebate = reader.GetInt32(reader.GetOrdinal("Rebate"));
         item.VipRebate = reader.GetInt32(reader.GetOrdinal("VipRebate"));
         item.VipPrice = reader.GetDecimal(reader.GetOrdinal("VipPrice"));
         item.IsMain = reader.GetBoolean(reader.GetOrdinal("IsMain"));
     }
     reader.Close();
     return item;
 }
开发者ID:cathychen00,项目名称:003.DianZiShangWu,代码行数:55,代码来源:Book.cs

示例7: GetTodayOrders

 /// <summary>
 /// 获取今日订单信息
 /// </summary>
 /// <returns></returns>
 public IList<OrdersInfo> GetTodayOrders()
 {
     SqlHelper objSqlHelper = new SqlHelper();
     List<OrdersInfo> orders = new List<OrdersInfo>();
     SqlDataReader reader = objSqlHelper.ExecuteReader("je_Order_GetTodayOrders");
     while (reader.Read())
     {
         OrdersInfo item = GetOrdersByID(reader.GetInt64(reader.GetOrdinal("OrderID")));
         orders.Add(item);
     }
     reader.Close();
     return orders;
 }
开发者ID:cathychen00,项目名称:003.DianZiShangWu,代码行数:17,代码来源:Orders.cs

示例8: GetEmailFormat

 public IList<EmailFormatInfo> GetEmailFormat()
 {
     SqlHelper objSqlHelper = new SqlHelper();
     List<EmailFormatInfo> emails = new List<EmailFormatInfo>();
     SqlDataReader reader = objSqlHelper.ExecuteReader("je_Email_GetEmailFormat");
     while (reader.Read())
     {
         EmailFormatInfo item =GetEmailFormatByID( reader.GetInt32(reader.GetOrdinal("ID")));
         emails.Add(item);
     }
     reader.Close();
     return emails;
 }
开发者ID:cathychen00,项目名称:003.DianZiShangWu,代码行数:13,代码来源:EmailFormat.cs

示例9: GetAllName

 public List<string> GetAllName()
 {
     List<string> allName = new List<string>();
     SqlHelper helper = new SqlHelper();
     var Reader = helper.ExecuteReader("P_GetAllName");
     while (Reader.Read())
     {
         allName.Add(Reader["Name"].ToString());
     }
     if (!Reader.IsClosed)
         Reader.Close();
     return allName;
 }
开发者ID:xuexisd,项目名称:tryfolder,代码行数:13,代码来源:OperDB.cs

示例10: GetPoll

 public IList<PollInfo> GetPoll()
 {
     SqlHelper objSqlHelper = new SqlHelper();
     List<PollInfo> pl = new List<PollInfo>();
     SqlDataReader reader = objSqlHelper.ExecuteReader("je_Poll_GetPoll");
     while (reader.Read())
     {
         PollInfo item = GetPollByID(reader.GetInt32(reader.GetOrdinal("PollID")));
         pl.Add(item);
     }
     reader.Close();
     return pl;
 }
开发者ID:cathychen00,项目名称:003.DianZiShangWu,代码行数:13,代码来源:Poll.cs

示例11: GetMainPublishs

 public IList<PublishInfo> GetMainPublishs()
 {
     SqlHelper objSqlHelper = new SqlHelper();
     List<PublishInfo> publishs = new List<PublishInfo>();
     SqlDataReader reader = objSqlHelper.ExecuteReader("je_Pb_GetMainPublishs");
     while (reader.Read())
     {
         PublishInfo item = GetPublishByID(reader.GetInt32(reader.GetOrdinal("publishID")));
         publishs.Add(item);
     }
     reader.Close();
     return publishs;
 }
开发者ID:cathychen00,项目名称:003.DianZiShangWu,代码行数:13,代码来源:Publish.cs

示例12: GetMainHelpClass

 public IList<HelpClassInfo> GetMainHelpClass()
 {
     SqlHelper objSqlHelper = new SqlHelper();
     List<HelpClassInfo> helpClass = new List<HelpClassInfo>();
     SqlDataReader reader = objSqlHelper.ExecuteReader("je_HC_GetMainHelpClass");
     while (reader.Read())
     {
         HelpClassInfo item = GetHelpClassByID(reader.GetInt32(reader.GetOrdinal("ClassID")));
         helpClass.Add(item);
     }
     reader.Close();
     return helpClass;
 }
开发者ID:cathychen00,项目名称:003.DianZiShangWu,代码行数:13,代码来源:HelpClass.cs

示例13: GetTopDownLoad

  /// <summary>
  /// 获取下载排行
  /// </summary>
  /// <returns></returns>
 public IList<DownLoadInfo> GetTopDownLoad()
 {
     SqlHelper objSqlHelper = new SqlHelper();
     List<DownLoadInfo> downLoads = new List<DownLoadInfo>();
     SqlDataReader reader = objSqlHelper.ExecuteReader("je_DL_GetTopDownLoad");
     while (reader.Read())
     {
         DownLoadInfo item = GetDownLoadByID(reader.GetInt32(reader.GetOrdinal("DownID")));
         downLoads.Add(item);
     }
     reader.Close();
     return downLoads;
 }
开发者ID:cathychen00,项目名称:003.DianZiShangWu,代码行数:17,代码来源:DownLoad.cs

示例14: GetSendArea

 public IList<SendAreaInfo> GetSendArea()
 {
     SqlHelper objSqlHelper = new SqlHelper();
     List<SendAreaInfo> sendAreas = new List<SendAreaInfo>();
     SqlDataReader reader = objSqlHelper.ExecuteReader("je_Area_GetArea");
     while (reader.Read())
     {
         SendAreaInfo item = GetSendAreaByID(reader.GetInt32(reader.GetOrdinal("AreaID")));
         sendAreas.Add(item);
     }
     reader.Close();
     return sendAreas;
 }
开发者ID:cathychen00,项目名称:003.DianZiShangWu,代码行数:13,代码来源:SendArea.cs

示例15: GetHelp

 public IList<HelpInfo> GetHelp()
   {
     
       SqlHelper objSqlHelper = new SqlHelper();
       List<HelpInfo> helps = new List<HelpInfo>();
       SqlDataReader reader = objSqlHelper.ExecuteReader("je_Help_GetHelp");
       while (reader.Read())
       {
           HelpInfo item = GetHelpByID(reader.GetInt32(reader.GetOrdinal("helpID")));
           helps.Add(item);
       }
       reader.Close();
       return helps;
   }
开发者ID:cathychen00,项目名称:003.DianZiShangWu,代码行数:14,代码来源:Help.cs


注:本文中的SqlHelper.ExecuteReader方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。