本文整理汇总了C#中IDataReader.GetNullableString方法的典型用法代码示例。如果您正苦于以下问题:C# IDataReader.GetNullableString方法的具体用法?C# IDataReader.GetNullableString怎么用?C# IDataReader.GetNullableString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDataReader
的用法示例。
在下文中一共展示了IDataReader.GetNullableString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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"))
{
}
示例2: InflateShipWithCurrentStatus
private ShipWithCurrentStatus InflateShipWithCurrentStatus(IDataReader dr)
{
var ship = new ShipWithCurrentStatus();
this.PopulateCoreFields(ship, dr);
ship.SolarSystemID = dr.GetNullableInt64("SolarSystemID");
ship.SolarSystemName = dr.GetNullableString("SolarSystemName");
ship.JobID = dr.GetNullableInt64("JobID");
ship.JobDescription = dr.GetNullableString("JobDescription");
return ship;
}
示例3: PopulateRDatabase
private RDatabase PopulateRDatabase(IDataReader reader)
{
return new RDatabase
{
UserId = reader.GetString(reader.GetOrdinal("UserId")),
RdbmsType = reader.GetString(reader.GetOrdinal("RdbmsType")),
ProviderName = reader.GetString(reader.GetOrdinal("ProviderName")),
Profile = reader.GetNullableString("Profile"),
Password = reader.GetString(reader.GetOrdinal("Password")),
IsTemplate = reader.GetBoolean(reader.GetOrdinal("IsTemplate")),
Id = reader.GetGuid(reader.GetOrdinal("Id")),
Description = reader.GetNullableString("Description"),
DataSource = reader.GetString(reader.GetOrdinal("DataSource")),
CatalogName = reader.GetString(reader.GetOrdinal("CatalogName")),
CreateUserId = reader.GetNullableGuid(reader.GetOrdinal("CreateUserId")),
CreateBy = reader.GetNullableString(reader.GetOrdinal("CreateBy")),
CreateOn = reader.GetNullableDateTime(reader.GetOrdinal("CreateOn"))
};
}
示例4: MapWorkItem
private static IEnumerable<WorkItem> MapWorkItem(IDataReader reader)
{
var workItems = new List<WorkItem>();
while (reader != null && reader.Read())
{
var workItemId = reader.GetString(0);
var path = reader.GetString(1);
var wi = WorkItem.New(workItemId, path);
var ordinal = reader.GetNullableValue<int>(2);
var lastMoved = reader.GetNullableValue<DateTime>(3);
var timestamp = reader.GetNullableValue<DateTime>(4);
var status = (WorkItemStatus) (int) reader[5];
var parentId = reader.GetNullableString(6);
var parentType = reader.GetNullableValue<WorkItemParentType>(7);
var properties = reader.GetNullableString(8);
var classes = reader.GetNullableString(9);
wi = wi.UpdateStatus(status);
wi = ordinal.HasValue ? wi.UpdateOrdinal(ordinal.Value) : wi;
wi = lastMoved.HasValue ? wi.UpdateLastMoved(lastMoved.Value) : wi;
wi = timestamp.HasValue ? wi.UpdateTimestamp(timestamp.Value) : wi;
wi = properties != null ? wi.UpdateProperties(DeserializeProperties(properties)) : wi;
wi = classes != null ? wi.UpdateClasses(classes.Split('&')) : wi;
if (!string.IsNullOrEmpty(parentId) && parentType.HasValue)
{
wi = wi.UpdateParent(parentId, parentType.Value);
}
workItems.Add(wi);
}
return workItems;
}
示例5: MapWorkStep
private static IEnumerable<WorkStep> MapWorkStep(IDataReader reader)
{
var workSteps = new List<WorkStep>();
while (reader != null && reader.Read())
{
var path = reader.GetString(0);
var ordinal = reader.GetNullableValue<int>(1);
var title = reader.GetNullableString(2);
var type = (WorkStepType) reader.GetInt32(3);
var workItemClass = reader.GetNullableString(4);
var wipLimt = reader.GetNullableValue<int>(5);
var ws = WorkStep.New(path);
ws = ws.UpdateType(type);
if (ordinal.HasValue)
{
ws = ws.UpdateOrdinal(ordinal.Value);
}
if (title != null)
{
ws = ws.UpdateTitle(title);
}
if (workItemClass != null)
{
ws = ws.UpdateWorkItemClass(workItemClass);
}
if (wipLimt.HasValue)
{
ws = ws.UpdateWipLimit(wipLimt.Value);
}
workSteps.Add(ws);
}
return workSteps;
}