本文整理汇总了C#中System.Data.OleDb.OleDbDataReader.GetValueOrDefault方法的典型用法代码示例。如果您正苦于以下问题:C# OleDbDataReader.GetValueOrDefault方法的具体用法?C# OleDbDataReader.GetValueOrDefault怎么用?C# OleDbDataReader.GetValueOrDefault使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Data.OleDb.OleDbDataReader
的用法示例。
在下文中一共展示了OleDbDataReader.GetValueOrDefault方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetAuditInfoUpdate
public string GetAuditInfoUpdate(OleDbDataReader reader)
{
return reader.GetValueOrDefault<string>("UserName") + " on " + reader.GetValueOrDefault<DateTime>("UpdatedAt").ToShortDateString();
}
示例2: GetDiseaseFromReader
private Disease GetDiseaseFromReader(OleDbDataReader reader)
{
var d = new Disease
{
DisplayNameKey = reader.GetValueOrDefault<string>("DisplayName"),
DisplayName = TranslationLookup.GetValue(reader.GetValueOrDefault<string>("DisplayName"),
reader.GetValueOrDefault<string>("DisplayName")),
UserDefinedName = reader.GetValueOrDefault<string>("UserDefinedName"),
DiseaseType = TranslationLookup.GetValue(reader.GetValueOrDefault<string>("DiseaseType"),
reader.GetValueOrDefault<string>("DiseaseType")),
Id = reader.GetValueOrDefault<int>("ID")
};
if (!string.IsNullOrEmpty(d.UserDefinedName))
d.DisplayName = d.UserDefinedName;
return d;
}
示例3: GetAuditInfo
public string GetAuditInfo(OleDbDataReader reader)
{
return Translations.AuditCreated + ": " + reader.GetValueOrDefault<string>("CreatedBy") + " on " + reader.GetValueOrDefault<DateTime>("CreatedAt").ToShortDateString()
+ ", " + Translations.AuditUpdated + ": " + reader.GetValueOrDefault<string>("UserName") + " on " + reader.GetValueOrDefault<DateTime>("UpdatedAt").ToShortDateString();
}
示例4: AddIndicator
private void AddIndicator(OleDbDataReader reader, Dictionary<int, AdminLevelIndicators> dic, Func<AggregateIndicator, object, object> customAggRule)
{
int indicatorId = reader.GetValueOrDefault<int>("iid");
string key = reader.GetValueOrDefault<string>("iname") + indicatorId;
int adminLevelId = reader.GetValueOrDefault<int>("aid");
int indicatorDataType = reader.GetValueOrDefault<int>("DataTypeId");
int indicatorAggType = reader.GetValueOrDefault<int>("AggTypeId");
string indicatorValue = reader.GetValueOrDefault<string>("DynamicValue");
if (dic.ContainsKey(adminLevelId))
{
var newIndicator = new AggregateIndicator
{
IndicatorId = indicatorId,
DataType = indicatorDataType,
Value = indicatorValue,
AggType = indicatorAggType
};
if (dic[adminLevelId].Indicators.ContainsKey(key))
{
// only used in CM JRF doesn't need to aggregate the dropdownlists weighted values
dic[adminLevelId].Indicators[key] = IndicatorAggregator.Aggregate(newIndicator, dic[adminLevelId].Indicators[key], new List<IndicatorDropdownValue>());
}
else
dic[adminLevelId].Indicators.Add(key, newIndicator);
}
}