本文整理汇总了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"));
}
示例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"));
}
示例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"));
}
示例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"));
}
示例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"));
}
示例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"));
}
示例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" ) );
}
}
示例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"))
{
}
示例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;
}
示例10: MapRowToEntity
protected override object MapRowToEntity(IDataReader reader)
{
return new Exercise()
{
Id = reader.GetInt32(reader.GetOrdinal("ExerciseId")),
Title = reader.GetString(reader.GetOrdinal("Title"))
};
}
示例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));
}
示例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);
}
示例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"))
};
}
示例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;
}
示例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;
}