本文整理汇总了C#中IDataReader.GetInt32方法的典型用法代码示例。如果您正苦于以下问题:C# IDataReader.GetInt32方法的具体用法?C# IDataReader.GetInt32怎么用?C# IDataReader.GetInt32使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDataReader
的用法示例。
在下文中一共展示了IDataReader.GetInt32方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Result
public Result(IDataReader reader)
{
Set_id = reader.GetInt32 (0);
Card_id = reader.GetInt32 (1);
CardNumber = reader.GetInt32 (2);
TypeLine = reader.GetString (3);
CardName = reader.GetString (4);
CardText = reader.GetString (5);
CastingCost = reader.GetString (6);
Power = reader.GetString (7);
Toughness = reader.GetString (8);
bWhite = reader.GetBoolean (9);
bBlue = reader.GetBoolean (10);
bBlack = reader.GetBoolean (11);
bRed = reader.GetBoolean (12);
bGreen = reader.GetBoolean (13);
ConvertedManaCost = reader.GetInt32 (14);
SetName = reader.GetString (15);
Rarity = reader.GetString (16);
ImagePath = reader.GetString (17);
FlavorText = reader.GetString (18);
multiverse_id = reader.GetString (19);
Artist = reader.GetString (20);
isSplit = reader.GetInt32 (21);
splitName = reader.GetString (22);
}
示例2: 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"));
}
示例3: 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"));
}
示例4: 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"));
}
示例5: 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"));
}
示例6: ReadRandomNewCommitment
public static void ReadRandomNewCommitment(string event_Type, ref string name, ref int time_Length,
ref int maxTime, ref int minTime)
{
OpenDB("MakingTime.db");
_dbcm = _dbc.CreateCommand();
sqlQuery = "select count(*) as NumberOfRegions from Event_Type where Category = '" + event_Type + "'";
_dbcm.CommandText = sqlQuery;
Int32 rows = Convert.ToInt32(_dbcm.ExecuteScalar());
sqlQuery = "select * from Event_Type where Category = '" + event_Type + "'";
_dbcm.CommandText = sqlQuery;
_dbr = _dbcm.ExecuteReader();
int commitmentRow = UnityEngine.Random.Range(0, rows);
//Question
for(int countRows = 0; countRows < commitmentRow + 1; countRows += 1)
{
_dbr.Read();
}
name = _dbr.GetString(0);
time_Length = _dbr.GetInt32(1);
maxTime = _dbr.GetInt32(8);
minTime = _dbr.GetInt32(7);
_dbr.Close();
_dbr = null;
_dbcm.Dispose();
_dbcm = null;
_dbc.Close();
_dbc = null;
}
示例7: MeetingRoom
private MeetingRoom(IDataReader reader)
{
this.Id = reader.GetInt32(0);
this.Name = reader.GetString(1);
this.Capacity = reader.GetInt32(2);
this.Beacon = reader.IsDBNull(3) ? null : reader.GetString(3);
this.Timezone = reader.IsDBNull(4) ? null : reader.GetString(4);
}
示例8: MapRow
protected override object MapRow(IDataReader reader, int num)
{
TestObject to = new TestObject();
to.ObjectNumber = reader.GetInt32(0);
to.Age = reader.GetInt32(1);
to.Name = reader.GetString(2);
return to;
}
示例9: StarStart
public static void StarStart()
{
///////////////////////////////////////////////////////////////////[DB Query]
dbcmd = dbconn.CreateCommand();
string sqlQuery = "SELECT * FROM userTable";
dbcmd.CommandText = sqlQuery;
///////////////////////////////////////////////////////////////////[DB Query]
int cnt = 0;
reader = dbcmd.ExecuteReader();
while (reader.Read())
{
StarSingleTon.Instance.cPlanet = reader.GetInt32(cnt++);
StarSingleTon.Instance.cFood = reader.GetInt32(cnt++);
StarSingleTon.Instance.cTitanium = reader.GetInt32(cnt++);
StarSingleTon.Instance.cRE = reader.GetInt32(cnt++);
StarSingleTon.Instance.cYE = reader.GetInt32(cnt++);
StarSingleTon.Instance.cBE = reader.GetInt32(cnt++);
StarSingleTon.Instance.cOE = reader.GetInt32(cnt++);
StarSingleTon.Instance.cGE = reader.GetInt32(cnt++);
StarSingleTon.Instance.cVE = reader.GetInt32(cnt++);
StarSingleTon.Instance.cPE = reader.GetInt32(cnt++);
StarSingleTon.Instance.shipNum = reader.GetInt32(cnt++);
cnt = 0;
}
cnt = 0;
reader.Close();
reader = null;
sqlQuery = "SELECT * FROM zodiacTable WHERE rowid =" + StarSingleTon.Instance.rowid;
dbcmd.CommandText = sqlQuery;
reader = dbcmd.ExecuteReader();
while (reader.Read())
{
StarSingleTon.Instance.zID = reader.GetString(cnt++);
StarSingleTon.Instance.zodiac = reader.GetString(cnt++);
StarSingleTon.Instance.zName = reader.GetString(cnt++);
StarSingleTon.Instance.locationX = reader.GetFloat(cnt++);
StarSingleTon.Instance.locationY = reader.GetFloat(cnt++);
StarSingleTon.Instance.locationZ = reader.GetFloat(cnt++);
StarSingleTon.Instance.zOpen = reader.GetBoolean(cnt++);
StarSingleTon.Instance.zFind = reader.GetBoolean(cnt++);
StarSingleTon.Instance.needPE = reader.GetInt32(cnt++);
StarSingleTon.Instance.nowPE = reader.GetInt32(cnt++);
StarSingleTon.Instance.zActive = reader.GetBoolean(cnt++);
cnt = 0;
}
cnt = 0;
reader.Close();
reader = null;
StarSingleTon.Instance.setMainText();
StarSingleTon.Instance.setPointlight();
}
示例10: Airport
public Airport(IDataReader reader)
{
ID = reader.GetInt32(reader.GetOrdinal("id"));
name = reader.GetString(reader.GetOrdinal("name"));
country = reader.GetInt32(reader.GetOrdinal("country"));
city = reader.GetInt32(reader.GetOrdinal("city"));
code = reader.GetString(reader.GetOrdinal("code"));
string companies = reader.GetString(reader.GetOrdinal("company"));
company = Util.parse<int>(companies);
}
示例11: 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;
}
示例12: Document
public Document(IDataReader reader)
: this()
{
DocumentId = reader.GetInt64(0);
if (!reader.IsDBNull(1))
Filename = reader.GetString(1);
if (!reader.IsDBNull(2))
SourceChannelId = reader.GetInt64(2);
if (!reader.IsDBNull(3))
TargetChannelId = reader.GetInt64(3);
if (!reader.IsDBNull(4))
ContentType = (ContentType) Enum.Parse(typeof (ContentType), reader.GetString(4));
if (!reader.IsDBNull(5))
ContentId = reader.GetString(5);
if (!reader.IsDBNull(6))
DocumentKey = reader.GetString(6);
if (!reader.IsDBNull(7))
StreamName = reader.GetString(7);
if (!reader.IsDBNull(8))
Crc32 = reader.GetString(8);
if (!reader.IsDBNull(9))
Size = reader.GetInt32(9);
if (!reader.IsDBNull(10))
IsRead = reader.ReadBoolean(10);
if (!reader.IsDBNull(11))
DocumentFolder = reader.GetInt32(11);
if (!reader.IsDBNull(12))
Labels = reader.GetString(12);
if (!reader.IsDBNull(13))
DateReceived = reader.ReadDateTimeOrNull(13);
if (!reader.IsDBNull(14))
DateSent = reader.ReadDateTimeOrNull(14);
if (!reader.IsDBNull(15))
DateCreated = reader.ReadDateTimeOrNull(15);
if (!reader.IsDBNull(16))
DateModified = reader.ReadDateTimeOrNull(16);
}
示例13: SendRecordToGraphite
private void SendRecordToGraphite(string path, IDataReader myReader)
{
using (var client = new Graphite.GraphiteTcpClient(this.hostname, this.port, string.Empty))
{
while (myReader.Read())
{
var value = myReader.GetInt32(1);
var datetime = myReader.GetDateTime(0);
this.log.Debug(string.Format("Sending {2} [{0}] {1}", value, datetime, path));
client.Send(path, myReader.GetInt32(1), myReader.GetDateTime(0));
}
}
}
示例14: GetEmployee
private Employee GetEmployee(IDataReader reader)
{
return new Employee(
reader.GetString(reader.GetOrdinal("FirstName")),
reader.GetString(reader.GetOrdinal("LastName")),
reader.GetInt32(reader.GetOrdinal("ReportingScope")),
new ReportingArea(
reader.GetString(reader.GetOrdinal("SDst")),
reader.GetString(reader.GetOrdinal("PA")),
reader.IsDBNull(reader.GetOrdinal("ZoneName")) ? null : reader.GetString(reader.GetOrdinal("ZoneName")),
reader.IsDBNull(reader.GetOrdinal("RegionID")) ? null : (int?)reader.GetInt32(reader.GetOrdinal("RegionID")),
reader.IsDBNull(reader.GetOrdinal("RegionName")) ? null : reader.GetString(reader.GetOrdinal("RegionName")),
(ReportingScope)reader.GetInt32(reader.GetOrdinal("ReportingScope"))));
}
示例15: SetValue
/// <summary>
/// Convert IDataReader To ProductAttrInfo
/// </summary>
/// <param name="reader"></param>
/// <returns></returns>
public static ProductAttrInfo SetValue(IDataReader reader)
{
ProductAttrInfo info = new ProductAttrInfo();
int attrIDIndex = reader.GetOrdinal("AttrID");
int cateIDIndex = reader.GetOrdinal("CateID");
int attrNameIndex = reader.GetOrdinal("AttrName");
info.AttrID = reader.GetInt32(attrIDIndex);
info.CateID = reader.GetInt32(cateIDIndex);
info.AttrName = reader.GetString(attrNameIndex);
return info;
}