本文整理汇总了C#中System.Data.SqlClient.SqlDataReader.IntOrZero方法的典型用法代码示例。如果您正苦于以下问题:C# SqlDataReader.IntOrZero方法的具体用法?C# SqlDataReader.IntOrZero怎么用?C# SqlDataReader.IntOrZero使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Data.SqlClient.SqlDataReader
的用法示例。
在下文中一共展示了SqlDataReader.IntOrZero方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: _initfromRow
private void _initfromRow(SqlDataReader dr)
{
FrameId = dr.IntOrZero("FrameId");
PanelId = dr.IntOrZero("PanelId");
Duration = dr.IntOrDefault("Duration", 60);
Sort = dr.IntOrZero("Sort");
BeginsOn = dr.AsNullable<DateTime>("BeginsOn");
EndsOn = dr.AsNullable<DateTime>("EndsOn");
DateCreated = dr.AsNullable<DateTime>("DateCreated");
TemplateName = dr.StringOrDefault("TemplateName", "default");
Html = dr.StringOrBlank("Html");
FrameType = (FrameTypes)dr.IntOrZero("FrameType");
CacheInterval = dr.IntOrZero("CacheInterval");
CacheInterval = CacheInterval < 0 ? 0 : CacheInterval;
Version = BitConverter.ToUInt64(dr.ValueOrNull<byte[]>("Version"), 0); // is never a null
}
示例2: _initFromRow
private void _initFromRow(SqlDataReader r)
{
PanelId = r.IntOrZero("PanelId");
Top = r.IntOrZero("Top");
Left = r.IntOrZero("Left");
Width = r.IntOrZero("Width");
Height = r.IntOrZero("Height");
FadeLength = r.ValueOrDefault<double>("FadeLength", 0);
Name = r.StringOrBlank("Name").Trim();
if (Name == "")
Name = string.Format("Panel {0}", PanelId);
}
示例3: _initFromRow
private void _initFromRow(SqlDataReader r)
{
DisplayId = r.IntOrZero("DisplayId");
CanvasId = r.IntOrZero("CanvasId");
LocationId = r.IntOrZero("LocationId");
Host = r.StringOrBlank("Host").Trim();
NoScroll = r.Boolean("NoScroll");
NoCursor = r.Boolean("NoCursor");
ReadyTimeout = r.IntOrZero("ReadyTimeout");
PollInterval = r.IntOrZero("PollInterval");
ErrorLength = r.IntOrZero("ErrorLength");
Name = r.StringOrBlank("Name").Trim();
if (Name == "")
Name = string.Format("Display {0}", DisplayId);
if (r["RecycleTime"] != DBNull.Value)
{
RecycleTime = (TimeSpan)r["RecycleTime"];
}
}
示例4: _initFromRow
private void _initFromRow(SqlDataReader r)
{
LocationId = r.IntOrZero("LocationId");
LevelId = r.IntOrZero("LevelId");
TemperatureUnit = r.StringOrDefault("TemperatureUnit", "C").ToLower();
DateFormat = r.StringOrDefault("DateFormat", "LL");
TimeFormat = r.StringOrDefault("TimeFormat", "LT");
Latitude = r.ValueOrDefault<double>("Latitude", ServerGeoData.Latitude);
Longitude = r.ValueOrDefault<double>("Longitude", ServerGeoData.Longitude);
Woeid = r.IntOrZero("Woeid");
Culture = r.StringOrBlank("Culture");
Name = r.StringOrBlank("Name");
if (Name == "")
Name = string.Format("Location {0}", LocationId);
TimeZone = TimeZoneInfo.FindSystemTimeZoneById(
r.StringOrDefault("TimeZone", ServerGeoData.TimeZone.Id)
);
}