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


C# IDataReader.GetOrdinal方法代码示例

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


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

示例1: Airplane

 public Airplane(IDataReader reader)
 {
     ID = reader.GetInt32(reader.GetOrdinal("id"));
     seat = Util.parse<int>(reader.GetString(reader.GetOrdinal("seat")));
     type = reader.GetString(reader.GetOrdinal("type"));
     code = reader.GetString(reader.GetOrdinal("code"));
 }
开发者ID:KommuSoft,项目名称:CplKul2012,代码行数:7,代码来源:Airplane.cs

示例2: Booking

 public Booking(IDataReader reader)
 {
     ID = reader.GetInt32(reader.GetOrdinal("id"));
     flight = reader.GetInt32(reader.GetOrdinal("flight"));
     passenger = reader.GetInt32(reader.GetOrdinal("passenger"));
     seat = reader.GetInt32(reader.GetOrdinal("seat"));
 }
开发者ID:KommuSoft,项目名称:CplKul2012,代码行数:7,代码来源:Booking.cs

示例3: Location

 public Location(IDataReader reader)
 {
     ID = reader.GetInt32(reader.GetOrdinal("id"));
     start_airport = reader.GetInt32(reader.GetOrdinal("start_airport"));
     destination_airport = reader.GetInt32(reader.GetOrdinal("destination_airport"));
     distance = reader.GetInt32(reader.GetOrdinal("distance"));
 }
开发者ID:KommuSoft,项目名称:CplKul2012,代码行数:7,代码来源:Location.cs

示例4: Seat

 public Seat(IDataReader reader)
 {
     ID = reader.GetInt32(reader.GetOrdinal("id"));
     class_ = reader.GetInt32(reader.GetOrdinal("class"));
     number = reader.GetInt32(reader.GetOrdinal("number"));
     airplane = reader.GetInt32(reader.GetOrdinal("airplane"));
 }
开发者ID:KommuSoft,项目名称:CplKul2012,代码行数:7,代码来源:Seat.cs

示例5: SeatPrice

 public SeatPrice(IDataReader reader)
 {
     ID = reader.GetInt32(reader.GetOrdinal("id"));
     seat = reader.GetInt32(reader.GetOrdinal("seat"));
     flight = reader.GetInt32(reader.GetOrdinal("flight"));
     price = reader.GetDecimal(reader.GetOrdinal("price"));
 }
开发者ID:KommuSoft,项目名称:CplKul2012,代码行数:7,代码来源:SeatPrice.cs

示例6: ModuleInfo

 /// <summary>
 /// Initializes a new instance of the ModuleInfo class (Overloaded constructor)
 /// </summary>
 /// <param name="rdr">
 /// Safe DataReader
 /// </param>
 public ModuleInfo(IDataReader rdr)
 {
     mID = rdr.GetInt64(rdr.GetOrdinal("ID"));
     mName = rdr.GetString(rdr.GetOrdinal("ModuleName"));
     // mDescription = rdr.GetString("Description");
     mIsEnabled = rdr.GetString(rdr.GetOrdinal("IsEnabled")).Equals("A");
     mStatus = rdr.GetString(rdr.GetOrdinal("Status"));
 }
开发者ID:skgw,项目名称:GWHRA,代码行数:14,代码来源:ModuleInfo.cs

示例7: MenuItem

 public MenuItem( IDataReader reader, string purpose )
 {
     if ( purpose.ToString().Length > 0 )
     {
         ID = reader.GetInt64( reader.GetOrdinal( "SiteId" ) );
         Title = reader.GetString( reader.GetOrdinal( "SiteDesc" ) );
     }
 }
开发者ID:skgw,项目名称:GWHRA,代码行数:8,代码来源:MenuItem.cs

示例8: DbView

 /// <summary>
 /// 
 /// </summary>
 /// <param name="databaseId"></param>
 /// <param name="reader"></param>
 internal DbView(Guid databaseId, IDataReader reader)
     : this(databaseId, reader.GetString(reader.GetOrdinal("Id")),
         reader.GetString(reader.GetOrdinal("CatalogName")),
         reader.GetString(reader.GetOrdinal("SchemaName")),
         reader.GetString(reader.GetOrdinal("Name")),
         reader.GetNullableString("Description"))
 {
 }
开发者ID:mingkongbin,项目名称:anycmd,代码行数:13,代码来源:DbView.cs

示例9: Create

 public static Member Create(IDataReader reader)
 {
     var i = new Member();
     i.Id = reader.GetInt32(reader.GetOrdinal("Id"));
     i.FirstName = reader.GetString(reader.GetOrdinal("FirstName"));
     i.LastName = reader.GetString(reader.GetOrdinal("LastName"));
     return i;
 }
开发者ID:johnllao,项目名称:SimpleDataAccess,代码行数:8,代码来源:Program.cs

示例10: MapRowToEntity

 protected override object MapRowToEntity(IDataReader reader)
 {
     return new Exercise()
     {
         Id = reader.GetInt32(reader.GetOrdinal("ExerciseId")),
         Title = reader.GetString(reader.GetOrdinal("Title"))
     };
 }
开发者ID:andycornforth,项目名称:Training_Tracker,代码行数:8,代码来源:ExerciseRepository.cs

示例11: ToCategory

        public static AvailableCategoryDto ToCategory(IDataReader dbReader)
        {
            var idIndex = dbReader.GetOrdinal("ID");
            var titleIndex = dbReader.GetOrdinal("Title");

            return new AvailableCategoryDto(
                dbReader.GetString(idIndex),
                dbReader.GetString(titleIndex));
        }
开发者ID:alreva,项目名称:CQRS_Example,代码行数:9,代码来源:QueryServiceHelper.cs

示例12: StatesColumns

        /// <summary>
        ///   Initializes a new instance of the <see cref = "StatesColumns" /> class.
        /// </summary>
        /// <param name = "sourceDataReader">
        ///   The source data reader.
        /// </param>
        /// <exception cref = "ArgumentNullException">
        /// </exception>
        public StatesColumns(IDataReader sourceDataReader)
        {
            if (sourceDataReader == null)
            {
                throw new ArgumentNullException("sourceDataReader");
            }

            posName = sourceDataReader.GetOrdinal(nameColumnName);
            posCode = sourceDataReader.GetOrdinal(codeColumnName);
        }
开发者ID:ZacWalk,项目名称:diffractor-util,代码行数:18,代码来源:StatesColumns.cs

示例13: MapRowToEntity

 protected override object MapRowToEntity(IDataReader reader)
 {
     return new Person()
     {
         FirstName = reader.GetString(reader.GetOrdinal("FirstName")),
         LastName = reader.GetString(reader.GetOrdinal("LastName")),
         Email = reader.GetString(reader.GetOrdinal("Email")),
         Password = reader.GetString(reader.GetOrdinal("Password"))
     };
 }
开发者ID:andycornforth,项目名称:Television_Ratings,代码行数:10,代码来源:PersonRepository.cs

示例14: LoadQuizzes

 private IList<Subscriptions> LoadQuizzes(IDataReader reader)
 {
     IList<Subscriptions> quizzes = new List<Subscriptions>();
     while (reader.Read())
     {
         Subscriptions quiz = new Subscriptions(reader.GetString(reader.GetOrdinal("QuizTopic")), reader.GetString(reader.GetOrdinal("Period")), reader.IsDBNull(reader.GetOrdinal("PeriodYear")) ? null : (short?)reader.GetInt16(reader.GetOrdinal("PeriodYear")));
         quizzes.Add(quiz);
         _IdsByHashCode.Add(quiz.GetHashCode(), reader.GetInt32(reader.GetOrdinal("QuizDefinitionID")));
     }
     return quizzes;
 }
开发者ID:zeldafreak,项目名称:Area51,代码行数:11,代码来源:SubscriptionRepository.cs

示例15: LoadQuizzes

 private IList<Quiz> LoadQuizzes(IDataReader reader)
 {
     IList<Quiz> quizzes = new List<Quiz>();
     while (reader.Read())
     {
         Quiz quiz = new Quiz(reader.GetString(reader.GetOrdinal("QuizTopic")), reader.GetString(reader.GetOrdinal("Period")), reader.IsDBNull(reader.GetOrdinal("PeriodYear")) ? null : (int?)reader.GetInt32(reader.GetOrdinal("PeriodYear")));
         quizzes.Add(quiz);
         _IdsByHashCode.Add(quiz.GetHashCode(), reader.GetInt32(reader.GetOrdinal("QuizDefinitionID")));
     }
     return quizzes;
 }
开发者ID:zeldafreak,项目名称:Area51,代码行数:11,代码来源:QuizRepository.cs


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