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


C# StoredProcedure.ExecuteReader方法代码示例

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


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

示例1: GetAll

        public virtual List<TranslatableText> GetAll()
        {
            List<TranslatableText> all = new List<TranslatableText>();
            using (StoredProcedure sp = new StoredProcedure("TranslatableTexts_GetAll"))
            {
                using (SqlDataReader r = (SqlDataReader)sp.ExecuteReader())
                {
                    if (r != null)
                    {
                        while (r.Read())
                        {
                            TranslatableText item = new TranslatableText();

                            item.ID = Convert.ToString(r["ID"]);
                            item.GroupID = Convert.ToInt32(r["GroupID"]);
                            item.LangCode = Convert.ToString(r["LangCode"]);
                            item.Text = Convert.ToString(r["Value"]);

                            all.Add(item);
                        }
                    }
                }
            }
            return all;
        }
开发者ID:trifonov-mikhail,项目名称:Site1,代码行数:25,代码来源:TranslatableFields.cs

示例2: GetByLangGroup

		public Service GetByLangGroup(string language, int groupId)
		{
			Service item = null;
			using (StoredProcedure sp = new StoredProcedure("Services_GetByLangGroup"))
			{
				sp.Params.Add("@GroupID", System.Data.SqlDbType.Int).Value = groupId;
				sp.Params.Add("@LangCode", System.Data.SqlDbType.NChar).Value = language;
				using (SqlDataReader r = (SqlDataReader)sp.ExecuteReader())
				{
					if (r != null && r.Read())
					{
						item = new Service();
						item.ID = Convert.ToInt32(r["ID"]);
						item.LangCode = Convert.ToString(r["LangCode"]);
						item.Name = Convert.ToString(r["Name"]);
						item.Telephone = Convert.ToString(r["Telephone"]);
						item.ServiceStatusID = Convert.ToInt32(r["ServiceStatusID"]);
						item.GroupID = Convert.ToInt32(r["GroupID"]);
						item.CityID = Convert.ToInt32(r["CityID"]);
						item.RegionID = Convert.ToInt32(r["RegionID"]);
						item.Address = Convert.ToString(r["Address"]);
						item.Url = Convert.ToString(r["Url"]);
                        item.Publish = Convert.ToBoolean(r["Publish"]);
					}
				}
			}
			return item;
		}
开发者ID:trifonov-mikhail,项目名称:Site1,代码行数:28,代码来源:Services.cs

示例3: GetAll

        public List<iPadActionSerial> GetAll()
        {
            List<iPadActionSerial> items = new List<iPadActionSerial>();
            using (StoredProcedure sp = new StoredProcedure("iPadActionSerial_GetAll"))
            {
                var r = sp.ExecuteReader();

                if (r != null)
                {
                    while (r.Read())
                    {
                        iPadActionSerial item = new iPadActionSerial {
                                BuyDate = Convert.ToDateTime(r["BuyDate"]),
                                Email = Convert.ToString(r["Email"]),
                                Seller = Convert.ToInt32(r["Seller"]),
                                ID = Convert.ToInt32(r["ID"]),
                                Serial = Convert.ToString(r["Serial"]),
                                SellerName = Convert.ToString(r["SellerName"]),
                                Status = Convert.ToInt32(r["Status"])
                        };

                        items.Add(item);
                    }
                }
            }

            return items;
        }
开发者ID:trifonov-mikhail,项目名称:Site1,代码行数:28,代码来源:iPadActionSerials.cs

示例4: GetAll

        public List<SerialNumber> GetAll()
        {
            List<SerialNumber> all = new List<SerialNumber>();
            using (StoredProcedure sp = new StoredProcedure("SerialNumbers_GetAll"))
            {
                using (SqlDataReader r = (SqlDataReader)sp.ExecuteReader())
                {
                    if (r != null)
                    {
                        while (r.Read())
                        {
                            SerialNumber item = new SerialNumber();

                            item.ID = Convert.ToInt32(r["ID"]);
                            item.Number = Convert.ToString(r["SerialNumber"]);
                            item.ServiceID = NullableConverter.ToInt32(r["ServiceID"]);
                            item.AdminID = Convert.ToInt32(r["AdminID"]);
                            item.CreatedDate = Convert.ToDateTime(r["CreatedDate"]);
                            item.ModifiedDate = NullableConverter.ToDateTime(r["ModifiedDate"]);

                            all.Add(item);
                        }
                    }
                }
            }
            return all;
        }
开发者ID:trifonov-mikhail,项目名称:Site1,代码行数:27,代码来源:SerialNumbers.cs

示例5: GetAll

        public virtual List<HomePageBlock> GetAll(string langCode)
        {
            List<HomePageBlock> all = new List<HomePageBlock>();
            using (StoredProcedure sp = new StoredProcedure("HomePageBlocks_GetAll"))
            {
                sp.Params.Add("@LangCode", System.Data.SqlDbType.NChar).Value = langCode;
                using (SqlDataReader r = (SqlDataReader)sp.ExecuteReader())
                {
                    if (r != null)
                    {
                        while (r.Read())
                        {
                            HomePageBlock item = new HomePageBlock();

                            item.ID = Convert.ToInt32(r["ID"]);
                            item.GroupID = Convert.ToInt32(r["GroupID"]);
                            item.LangCode = Convert.ToString(r["LangCode"]);
                            item.LinkUrl = Convert.ToString(r["LinkUrl"]);
                            item.LinkText = Convert.ToString(r["LinkText"]);
                            item.OrderNumber = Convert.ToInt32(r["OrderNumber"]);
                            item.IsActive = Convert.ToBoolean(r["IsActive"]);
                            item.DateCreated = Convert.ToDateTime(r["DateCreated"]);

                            all.Add(item);
                        }
                    }
                }
            }
            return all;
        }
开发者ID:trifonov-mikhail,项目名称:Site1,代码行数:30,代码来源:HomePageBlocks.cs

示例6: GetAll

        public virtual List<SuccessStory> GetAll(string language)
        {
            List<SuccessStory> all = new List<SuccessStory>();
            using (StoredProcedure sp = new StoredProcedure("SuccessStories_GetAll"))
            {
                using (SqlDataReader r = (SqlDataReader)sp.ExecuteReader())
                {
                    if (r != null)
                    {
                        while (r.Read())
                        {
                            SuccessStory item = new SuccessStory();

                            item.ID = Convert.ToInt32(r["ID"]);
                            item.GroupID = Convert.ToInt32(r["GroupID"]);
                            item.LangCode = Convert.ToString(r["LangCode"]);
                            item.Title = Convert.ToString(r["Title"]);
                            item.Text = Convert.ToString(r["Text"]);
                            item.Date = NullableConverter.ToDateTime(r["Date"]);
                            item.PdfFileName = Convert.ToString(r["PdfFileName"]);

                            all.Add(item);
                        }
                    }
                }
            }
            return all;
        }
开发者ID:trifonov-mikhail,项目名称:Site1,代码行数:28,代码来源:SuccessStories.cs

示例7: GetByLang

        public virtual List<SuccessStory> GetByLang(string langCode)
        {
            List<SuccessStory> all = new List<SuccessStory>();
            using (StoredProcedure sp = new StoredProcedure("SuccessStory_GetByLang"))
            {
                sp.Params.Add("@LangCode", System.Data.SqlDbType.NChar).Value = langCode;

                using (SqlDataReader r = (SqlDataReader)sp.ExecuteReader())
                {
                    if (r != null)
                    {
                        while (r.Read())
                        {
                            SuccessStory item = new SuccessStory();

                            item.ID = Convert.ToInt32(r["ID"]);
                            item.GroupID = Convert.ToInt32(r["GroupID"]);
                            item.LangCode = Convert.ToString(r["LangCode"]);
                            item.Title = Convert.ToString(r["Title"]);
                            item.Text = Convert.ToString(r["Text"]);
                            item.Date = NullableConverter.ToDateTime(r["Date"]);
                            item.HasImage = Convert.ToBoolean(r["HasImage"]);
                            item.HasPdfFile = Convert.ToBoolean(r["HasPdfFile"]);
                            item.PdfFileName = Convert.ToString(r["PdfFileName"]);
                            all.Add(item);
                        }
                    }
                }
            }
            return all;
        }
开发者ID:trifonov-mikhail,项目名称:Site1,代码行数:31,代码来源:SuccessStories.cs

示例8: GetAllByLanguage

 //
 public List<City> GetAllByLanguage(string language)
 {
     List<City> all = new List<City>();
     using (StoredProcedure sp = new StoredProcedure("Cities_GetAllByLanguage"))
     {
         sp.Params.Add("@LangCode", SqlDbType.NChar).Value = language;
         using (SqlDataReader r = (SqlDataReader)sp.ExecuteReader())
         {
             if (r != null)
             {
                 while (r.Read())
                 {
                     City item = new City();
                     item.ID = Convert.ToInt32(r["ID"]);
                     item.LangCode = Convert.ToString(r["LangCode"]);
                     item.Name = Convert.ToString(r["Name"]);
                     item.RegionID = Convert.ToInt32(r["RegionID"]);
                     item.GroupID = Convert.ToInt32(r["GroupID"]);
                     all.Add(item);
                 }
             }
         }
     }
     return all;
 }
开发者ID:trifonov-mikhail,项目名称:Site1,代码行数:26,代码来源:Cities.cs

示例9: GetAllByLanguage

		public List<Service> GetAllByLanguage(string language)
		{
			List<Service> all = new List<Service>();
			using (StoredProcedure sp = new StoredProcedure("Services_GetAllByLanguage"))
			{
				sp.Params.Add("@LangCode", SqlDbType.NChar).Value = language;
				using (SqlDataReader r = (SqlDataReader)sp.ExecuteReader())
				{
					if (r != null)
					{
						while (r.Read())
						{
							Service item = new Service();
							item.ID = Convert.ToInt32(r["ID"]);
							item.LangCode = Convert.ToString(r["LangCode"]);
							item.Name = Convert.ToString(r["Name"]);
							item.Telephone = Convert.ToString(r["Telephone"]);
							item.ServiceStatusID = Convert.ToInt32(r["ServiceStatusID"]);
							item.GroupID = Convert.ToInt32(r["GroupID"]);
							item.CityID = Convert.ToInt32(r["CityID"]);
							item.Url = Convert.ToString(r["Url"]);
                            item.Publish = Convert.ToBoolean(r["Publish"]);
							all.Add(item);
						}
					}
				}
			}
			return all;
		}
开发者ID:trifonov-mikhail,项目名称:Site1,代码行数:29,代码来源:Services.cs

示例10: GetAllByLanguage

 public List<Product> GetAllByLanguage(string language)
 {
     List<Product> all = new List<Product>();
     using (StoredProcedure sp = new StoredProcedure("Products_GetAllByLanguage"))
     {
         sp.Params.Add("@LangCode", SqlDbType.NChar).Value = language;
         using (SqlDataReader r = (SqlDataReader)sp.ExecuteReader())
         {
             if (r != null)
             {
                 while (r.Read())
                 {
                     Product item = new Product();
                     item.ID = Convert.ToInt32(r["ID"]);
                     item.LangCode = Convert.ToString(r["LangCode"]);
                     item.Name = Convert.ToString(r["Name"]);
                     item.GroupID = Convert.ToInt32(r["GroupID"]);
                     item.OrderNumber = Convert.ToInt32(r["OrderNumber"]);
                     item.CategoryID = Convert.ToInt32(r["CategoryID"]);
                     item.Url = Convert.ToString(r["Url"]);
                     item.ImageLenght = Convert.ToInt32(r["ImageLenght"]);
                     all.Add(item);
                 }
             }
         }
     }
     return all;
 }
开发者ID:trifonov-mikhail,项目名称:Site1,代码行数:28,代码来源:Products.cs

示例11: GetByFileID

        public List<DownloadUserForm> GetByFileID(int id)
        {
            List<DownloadUserForm> res = new List<DownloadUserForm>();
            using (StoredProcedure sp = new StoredProcedure(string.Format("SELECT * FROM DownloadUserForms WHERE FileID = @FileID")))
            {
                sp.command.CommandType = CommandType.Text;
                sp.Params.Add("FileID", SqlDbType.NVarChar).Value = id;
                using (SqlDataReader r = (SqlDataReader)sp.ExecuteReader())
                {
                    if (r != null)
                    {

                        while (r.Read())
                        {
                            DownloadUserForm d = new DownloadUserForm();
                            d.Url = r.GetString(r.GetOrdinal("Url"));
                            d.FileID = r.GetInt32(r.GetOrdinal("FileID"));
                            d.ID = r.GetInt32(r.GetOrdinal("ID"));
                            d.Email = r.GetString(r.GetOrdinal("Email"));
                            d.FirstName = r.GetString(r.GetOrdinal("FirstName"));
                            d.LastName = r.GetString(r.GetOrdinal("LastName"));
                            res.Add(d);
                        }

                    }
                }
            }
            return res;
        }
开发者ID:trifonov-mikhail,项目名称:Site1,代码行数:29,代码来源:DownloadUserForms.cs

示例12: GetAllByLanguage

 public List<Specialization> GetAllByLanguage(string language)
 {
     List<Specialization> all = new List<Specialization>();
     using (StoredProcedure sp = new StoredProcedure("Specializations_GetAllByLanguage"))
     {
         sp.Params.Add("@LangCode", SqlDbType.NChar).Value = language;
         using (SqlDataReader r = (SqlDataReader)sp.ExecuteReader())
         {
             if (r != null)
             {
                 while (r.Read())
                 {
                     Specialization item = new Specialization();
                     item.ID = Convert.ToInt32(r["ID"]);
                     item.LangCode = Convert.ToString(r["LangCode"]);
                     item.Name = Convert.ToString(r["Name"]);
                     item.Description = Convert.ToString(r["Description"]);
                     item.GroupID = Convert.ToInt32(r["GroupID"]);
                     all.Add(item);
                 }
             }
         }
     }
     return all;
 }
开发者ID:trifonov-mikhail,项目名称:Site1,代码行数:25,代码来源:Specializations.cs

示例13: GetByID

 public virtual ContactForm GetByID(int id)
 {
     ContactForm item = null;
     using (StoredProcedure sp = new StoredProcedure("ContactForms_GetByID"))
     {
         sp.Params.Add("@ID", System.Data.SqlDbType.Int).Value = id;
         using (SqlDataReader r = (SqlDataReader)sp.ExecuteReader())
         {
             if (r != null && r.Read())
             {
                 item = new ContactForm(r);
             }
         }
     }
     return item;
 }
开发者ID:trifonov-mikhail,项目名称:Site1,代码行数:16,代码来源:ContactForms.cs

示例14: GetByID

 public LogMessage GetByID(int id)
 {
     LogMessage item = null;
     using (StoredProcedure sp = new StoredProcedure("Log_GetByID"))
     {
         sp.Params.Add("@ID", System.Data.SqlDbType.Int).Value = id;
         using (SqlDataReader r = (SqlDataReader)sp.ExecuteReader())
         {
             if (r != null && r.Read())
             {
                 item = new LogMessage(r);
             }
         }
     }
     return item;
 }
开发者ID:trifonov-mikhail,项目名称:Site1,代码行数:16,代码来源:Log.cs

示例15: GetByID

 public StatusRequest GetByID(int id)
 {
     StatusRequest item = null;
     using (StoredProcedure sp = new StoredProcedure("StatusRequests_GetByID"))
     {
         sp.Params.Add("@ID", System.Data.SqlDbType.Int).Value = id;
         using (SqlDataReader r = (SqlDataReader)sp.ExecuteReader())
         {
             if (r != null && r.Read())
             {
                 item = new StatusRequest(r);
             }
         }
     }
     return item;
 }
开发者ID:trifonov-mikhail,项目名称:Site1,代码行数:16,代码来源:StatusRequests.cs


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