本文整理汇总了C#中System.Data.SQLite.SQLiteDataReader.GetInt32方法的典型用法代码示例。如果您正苦于以下问题:C# SQLiteDataReader.GetInt32方法的具体用法?C# SQLiteDataReader.GetInt32怎么用?C# SQLiteDataReader.GetInt32使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Data.SQLite.SQLiteDataReader
的用法示例。
在下文中一共展示了SQLiteDataReader.GetInt32方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ActivityExtractor
/* Returns a Activity using a SQLiteDataReader and a dictionary mapping the attributes to a index.
*/
private Activity ActivityExtractor(SQLiteDataReader reader, Dictionary<string, int> attributeIndexDict)
{
return new Activity(reader.GetInt32(attributeIndexDict["activityId"]),
reader.GetInt32(attributeIndexDict["seqNum"]), reader.GetString(attributeIndexDict["workoutName"]),
reader.GetInt32(attributeIndexDict["numSets"]), reader.GetInt32(attributeIndexDict["workoutVersion"]),
reader.GetString(attributeIndexDict["exerciseName"]), reader.GetInt32(attributeIndexDict["exerciseVersion"]));
}
示例2: DbChannel
internal DbChannel(SignalSource source, SQLiteDataReader r, IDictionary<string, int> field,
DataRoot dataRoot, IDictionary<string,bool> encryptionInfo)
{
this.SignalSource = source;
this.RecordIndex = r.GetInt32(field["channel_handle"]);
this.Bits = r.GetInt32(field["list_bits"]);
bool isTv = (Bits & BITS_Tv) != 0;
bool isRadio = (Bits & BITS_Radio) != 0;
bool isAnalog = (source & SignalSource.Analog) != 0;
if (isAnalog && !isTv)
{
this.IsDeleted = true;
return;
}
if (isTv) this.SignalSource |= SignalSource.Tv;
if (isRadio) this.SignalSource |= SignalSource.Radio;
this.Lock = (Bits & BITS_Locked) != 0;
this.OldProgramNr = r.GetInt32(field["channel_number"]);
this.Favorites = this.ParseFavorites(Bits);
if (isAnalog)
this.ReadAnalogData(r, field);
else
this.ReadDvbData(r, field, dataRoot, encryptionInfo);
}
示例3: Report
public Report()
{
InitializeComponent();
// Connect to database file
sql_con = new SQLiteConnection("Data Source=" + applicationPath + "\\ExpenseTracker.db;Version=3;New=False;Compress=True;");
sql_cmd = new SQLiteCommand();
sql_con.Open();
sql_cmd.Connection = sql_con;
sql_cmd.CommandText = "SELECT * FROM Month";
sql_reader = sql_cmd.ExecuteReader();
while (sql_reader.Read())
{
dataGridView.Rows.Add(
sql_reader.GetInt32(0),
CustomDate.GetThaiMonth(sql_reader.GetInt32(1)),
sql_reader.GetDecimal(2).ToString("#,#0.00#"),
sql_reader.GetDecimal(3).ToString("#,#0.00#"),
sql_reader.GetDecimal(4).ToString("#,#0.00#")
);
}
sql_reader.Close();
dataGridView.ClearSelection();
}
示例4: ReadDvbData
protected void ReadDvbData(SQLiteDataReader r, IDictionary<string, int> field, DataRoot dataRoot,
IDictionary<string, bool> encryptionInfo)
{
string longName, shortName;
this.GetChannelNames(r.GetString(field["channel_label"]), out longName, out shortName);
this.Name = longName;
this.ShortName = shortName;
this.RecordOrder = r.GetInt32(field["channel_order"]);
this.FreqInMhz = (decimal)r.GetInt32(field["frequency"]) / 1000;
int serviceType = r.GetInt32(field["dvb_service_type"]);
this.ServiceType = serviceType;
this.OriginalNetworkId = r.GetInt32(field["onid"]);
this.TransportStreamId = r.GetInt32(field["tsid"]);
this.ServiceId = r.GetInt32(field["sid"]);
int bits = r.GetInt32(field["list_bits"]);
this.Favorites = this.ParseFavorites(bits);
if ((this.SignalSource & SignalSource.Sat) != 0)
{
int satId = r.GetInt32(field["sat_id"]);
var sat = dataRoot.Satellites.TryGet(satId);
if (sat != null)
{
this.Satellite = sat.Name;
this.SatPosition = sat.OrbitalPosition;
int tpId = satId * 1000000 + (int)this.FreqInMhz;
var tp = dataRoot.Transponder.TryGet(tpId);
if (tp != null)
{
this.SymbolRate = tp.SymbolRate;
}
}
}
this.Encrypted = encryptionInfo.TryGet(this.Uid);
}
示例5: printToConsole
public string printToConsole(SQLiteDataReader readerDB, int index)
{
if (readerDB.IsDBNull(index))
{
//return "NULL";
return "";
}
else
{
String dataObject = readerDB.GetFieldType(index).ToString();
switch (dataObject)
{
case "System.Int32":
return readerDB.GetInt32(index).ToString();
case "System.DateTime":
DateTime date = readerDB.GetDateTime(index);
return Convert.ToString(date);
case "System.String":
return readerDB.GetString(index);
default:
return "Unknown";
}
}
}
示例6: SortieStatisticData
public SortieStatisticData(SQLiteDataReader rpReader) : base(rpReader)
{
Count = rpReader.GetInt32("count");
FuelConsumption = rpReader.GetInt32("fuel_consumption");
BulletConsumption = rpReader.GetInt32("bullet_consumption");
SteelConsumption = rpReader.GetInt32("steel_consumption");
BauxiteConsumption = rpReader.GetInt32("bauxite_consumption");
BucketConsumption = rpReader.GetInt32("bucket_consumption");
RankingPoint = rpReader.GetDouble("ranking_point");
SRankCount = rpReader.GetInt32("s_rank_count");
ARankCount = rpReader.GetInt32("a_rank_count");
BRankCount = rpReader.GetInt32("b_rank_count");
FailureRankCount = rpReader.GetInt32("failure_rank_count");
}
示例7: FateRecord
internal FateRecord(SQLiteDataReader rpReader)
{
ID = rpReader.GetInt64("time");
var rMasterInfo = KanColleGame.Current.MasterInfo;
var rMasterID = rpReader.GetInt32("master_id");
IsEquipment = rpReader.GetBoolean("is_equipment");
if (!IsEquipment)
Ship = rMasterInfo.Ships[rMasterID];
else
Equipment = rMasterInfo.Equipment[rMasterID];
Level = rpReader.GetInt32("level");
Proficiency = rpReader.GetInt32("proficiency");
Fate = (Fate)rpReader.GetInt32("fate");
}
示例8: SetExtractor
/* Returns a Set using a SQLiteDataReader and a dictionary mapping the attributes to a index.
*/
private Set SetExtractor(SQLiteDataReader reader, Dictionary<string, int> attributeIndexDict)
{
return new Set(reader.GetInt32(attributeIndexDict["day"]), reader.GetInt32(attributeIndexDict["month"]),
reader.GetInt32(attributeIndexDict["year"]), reader.GetInt32(attributeIndexDict["setSeqNum"]),
reader.GetInt32(attributeIndexDict["activityId"]), reader.GetDouble(attributeIndexDict["weight"]),
reader.GetInt32(attributeIndexDict["secs"]), reader.GetInt32(attributeIndexDict["reps"]));
}
示例9: ResourceRecord
public ResourceRecord(SQLiteDataReader rpReader)
{
ID = rpReader.GetInt64("time");
Fuel = rpReader.GetInt32("fuel");
Bullet = rpReader.GetInt32("bullet");
Steel = rpReader.GetInt32("steel");
Bauxite = rpReader.GetInt32("bauxite");
InstantConstruction = rpReader.GetInt32("instant_construction");
Bucket = rpReader.GetInt32("bucket");
DevelopmentMaterial = rpReader.GetInt32("development_material");
ImprovementMaterial = rpReader.GetInt32("improvement_material");
}
示例10: ReadTranslationMemory
private TranslationMemory ReadTranslationMemory(SQLiteDataReader reader)
{
TranslationMemory tm = new TranslationMemory();
tm.tmid = reader.GetInt32(0); // tmid used for update
tm.japanese = GetSegmentFromXml(reader.GetString(4)); // source_segment
tm.chinese = GetSegmentFromXml(reader.GetString(6)); // target_segment
tm.tags += reader.GetString(8) + Environment.NewLine; // user
tm.tags += reader.GetString(9) + Environment.NewLine; // date
tm.tmname = Path.GetFileName(this.sourcePath);
return tm;
}
示例11: SortieConsumptionRecord
internal SortieConsumptionRecord(SQLiteDataReader rpReader) : base(rpReader)
{
ID = rpReader.GetInt64("id");
var rMapMaxHP = rpReader.GetInt32Optional("map_max_hp");
if (rMapMaxHP.HasValue)
{
var rMapHP = rpReader.GetInt32Optional("map_hp");
if (rMapHP.HasValue)
MapHP = new ClampedValue(rMapMaxHP.Value, rMapHP.Value);
}
Fuel = rpReader.GetInt32("fuel");
Bullet = rpReader.GetInt32("bullet");
Steel = rpReader.GetInt32("steel");
Bauxite = rpReader.GetInt32("bauxite");
Bucket = rpReader.GetInt32("bucket");
RankingPoint = rpReader.GetDoubleOptional("ranking_point");
}
示例12: SortieRecordBase
public SortieRecordBase(SQLiteDataReader rpReader)
{
var rMapID = rpReader.GetInt32("map");
Map = MapService.Instance.GetMasterInfo(rMapID);
var rEventMapDifficulty = rpReader.GetInt32Optional("difficulty");
if (rEventMapDifficulty.HasValue)
{
IsEventMap = true;
EventMapDifficulty = (EventMapDifficulty)rEventMapDifficulty.Value;
}
}
示例13: ParseFavorites
private void ParseFavorites(SQLiteDataReader r, IDictionary<string, int> field)
{
for (int i = 0; i < 4; i++)
{
int favIndex = r.GetInt32(field["profile" + (i + 1) + "index"]);
if (favIndex > 0)
{
this.Favorites |= (Favorites) (1 << i);
this.FavIndex[i] = favIndex;
}
}
}
示例14: ReadDvbData
protected void ReadDvbData(SQLiteDataReader r, IDictionary<string, int> field, DataRoot dataRoot, byte[] delivery)
{
int stype = r.GetInt32(field["stype"]);
this.SignalSource |= LookupData.Instance.IsRadioOrTv(stype);
this.ServiceType = stype;
int freq = r.GetInt32(field["freq"]);
if ((this.SignalSource & SignalSource.Sat) != 0)
{
// ReSharper disable PossibleLossOfFraction
this.FreqInMhz = freq/10;
// ReSharper restore PossibleLossOfFraction
int satId = r.GetInt32(field["physical_ch"]) >> 12;
var sat = dataRoot.Satellites.TryGet(satId);
if (sat != null)
{
this.Satellite = sat.Name;
this.SatPosition = sat.OrbitalPosition;
}
if (delivery.Length >= 7)
{
this.SymbolRate = (delivery[5] >> 4)*10000 + (delivery[5] & 0x0F)*1000 +
(delivery[6] >> 4)*100 + (delivery[6] & 0x0F)*10;
}
}
else
{
freq /= 1000;
this.FreqInMhz = freq;
this.ChannelOrTransponder = (this.SignalSource & SignalSource.Antenna) != 0 ?
LookupData.Instance.GetDvbtTransponder(freq).ToString() :
LookupData.Instance.GetDvbcTransponder(freq).ToString();
this.Satellite = (this.SignalSource & SignalSource.Antenna) != 0 ? "DVB-T" : "DVB-C";
}
this.OriginalNetworkId = r.GetInt32(field["onid"]);
this.TransportStreamId = r.GetInt32(field["tsid"]);
this.ServiceId = r.GetInt32(field["sid"]);
}
示例15: DbChannel
internal DbChannel(SQLiteDataReader r, IDictionary<string, int> field, DataRoot dataRoot, Dictionary<long, string> providers, Satellite sat, Transponder tp)
{
var chType = r.GetInt32(field["chType"]);
this.SignalSource = DbSerializer.ChTypeToSignalSource(chType);
this.RecordIndex = r.GetInt64(field["SRV.srvId"]);
this.OldProgramNr = r.GetInt32(field["major"]);
this.FreqInMhz = (decimal)r.GetInt32(field["freq"]) / 1000;
this.ChannelOrTransponder =
(this.SignalSource & SignalSource.DvbT) == SignalSource.DvbT ? LookupData.Instance.GetDvbtTransponder(this.FreqInMhz).ToString() :
(this.SignalSource & SignalSource.DvbC) == SignalSource.DvbC ? LookupData.Instance.GetDvbcTransponder(this.FreqInMhz).ToString() :
(this.SignalSource & SignalSource.Sat) == SignalSource.DvbS ? LookupData.Instance.GetAstraTransponder((int)this.FreqInMhz).ToString() :
"";
this.Name = DbSerializer.ReadUtf16(r, 6);
this.Hidden = r.GetBoolean(field["hidden"]);
this.Encrypted = r.GetBoolean(field["scrambled"]);
this.Lock = r.GetBoolean(field["lockMode"]);
this.Skip = !r.GetBoolean(field["numSel"]);
if (sat != null)
{
this.Satellite = sat.Name;
this.SatPosition = sat.OrbitalPosition;
}
if (tp != null)
{
this.Transponder = tp;
this.SymbolRate = tp.SymbolRate;
}
if ((this.SignalSource & SignalSource.Digital) != 0)
this.ReadDvbData(r, field, dataRoot, providers);
else
this.ReadAnalogData(r, field);
base.IsDeleted = this.OldProgramNr == -1;
}