本文整理汇总了C#中IDataReader.GetBoolean方法的典型用法代码示例。如果您正苦于以下问题:C# IDataReader.GetBoolean方法的具体用法?C# IDataReader.GetBoolean怎么用?C# IDataReader.GetBoolean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDataReader
的用法示例。
在下文中一共展示了IDataReader.GetBoolean方法的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: 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();
}
示例3: GetBoolean
public static bool GetBoolean(IDataReader dr, string columnName)
{
int ordinal = dr.GetOrdinal(columnName);
bool isDbNull = dr.IsDBNull(ordinal);
return isDbNull ? false : dr.GetBoolean(ordinal);
}
示例4: getBoolean
protected static bool getBoolean(IDataReader dataReader, int column)
{
if (!dataReader.IsDBNull(column))
return dataReader.GetBoolean(column);
return false;
}
示例5: GetBoolNullCheck
public static bool GetBoolNullCheck(IDataReader reader, int ordinal)
{
try {
return reader.IsDBNull(ordinal) || (reader.GetFieldType(ordinal).Name == "Int32" ?
reader.GetInt32(ordinal) > 0 : reader.GetFieldType(ordinal).Name == "Boolean" ? reader.GetBoolean(ordinal) : Convert.ToInt32(reader.GetString(ordinal)) > 0);
} catch (Exception) {
return true;
}
}
示例6: PopulateForumFromReader
private static Forum PopulateForumFromReader(IDataReader r)
{
return new Forum(r.GetInt32(0))
{
CategoryID = r.NullIntDbHelper(1),
Title = r.GetString(2),
Description = r.GetString(3),
IsVisible = r.GetBoolean(4),
IsArchived = r.GetBoolean(5),
SortOrder = r.GetInt32(6),
TopicCount = r.GetInt32(7),
PostCount = r.GetInt32(8),
LastPostTime = r.GetDateTime(9),
LastPostName = r.GetString(10),
UrlName = r.GetString(11),
ForumAdapterName = r.NullStringDbHelper(12),
IsQAForum = r.GetBoolean(13)
};
}
示例7: CreateLocalViewwwJobFromReader
private LocalViewwwJob CreateLocalViewwwJobFromReader(IDataReader reader)
{
return new LocalViewwwJob
{
RecordId = reader.GetInt32(0),
Creator = reader.GetInt32(1),
Created = reader.GetDateTime(2),
Session = reader.GetInt32(3),
StartTime = reader.GetDateTime(4),
Duration = reader.GetInt32(5),
Customer = reader.GetInt32(6),
Project = reader.GetInt32(7),
ProjectId = reader.GetString(8),
ProjectDescription = reader.GetString(9),
JobType = reader.GetInt32(10),
RateGroup = reader.GetInt32(11),
RateName = reader.GetInt32(12),
Description = reader.GetString(13),
Enabled = reader.GetBoolean(14),
ForceJobsEnabled = reader.GetBoolean(15)
};
}
示例8: MeetingRoomBooking
private MeetingRoomBooking(IDataReader reader)
{
this.Id = reader.GetInt32(0);
this.Day = reader.GetInt32(1);
this.From = reader.GetInt32(2);
this.Till = reader.GetInt32(3);
this.Users = reader.GetString(4);
this.meetingRoom = reader.GetInt32(5);
this.UsersNotified = reader.IsDBNull(6) ? false : reader.GetBoolean(6);
if (reader.IsDBNull(7))
this.NotifyUsers = new List<string>();
else
this.NotifyUsers = JsonConvert.DeserializeObject<List<string>>(reader.GetString(7));
this.UsersCheckedIn = reader.IsDBNull(8) ? null : reader.GetString(8);
}
示例9: RetrieveBool
/// <summary>
/// Retrieve a bool from a IDataReader
/// </summary>
/// <param name="dr">The IDataReader to read the string from</param>
/// <param name="columnName">The name of the column</param>
public static bool RetrieveBool(IDataReader dr,string columnName)
{
bool retVal = false;
try
{
retVal = dr.IsDBNull(dr.GetOrdinal(columnName)) ? false : dr.GetBoolean(dr.GetOrdinal(columnName));
}
catch (SqlException e)
{
throw new DatabaseException(_DatabaseExceptionUserMessage, "SqlException occured while retrieving the column:" + columnName, "RetrieveBool", e);
}
catch (IndexOutOfRangeException e)
{
throw new DatabaseException(_DatabaseExceptionUserMessage, "The name specified is not a valid column name:" + columnName, "RetrieveBool", e);
}
return retVal;
}
示例10: GetItem
private BaseItem GetItem(IDataReader reader)
{
var typeString = reader.GetString(0);
var type = _typeMapper.GetType(typeString);
if (type == null)
{
_logger.Debug("Unknown type {0}", typeString);
return null;
}
BaseItem item;
using (var stream = reader.GetMemoryStream(1))
{
try
{
item = _jsonSerializer.DeserializeFromStream(stream, type) as BaseItem;
if (item == null)
{
return null;
}
}
catch (SerializationException ex)
{
_logger.ErrorException("Error deserializing item", ex);
return null;
}
}
if (!reader.IsDBNull(2))
{
var hasStartDate = item as IHasStartDate;
if (hasStartDate != null)
{
hasStartDate.StartDate = reader.GetDateTime(2).ToUniversalTime();
}
}
if (!reader.IsDBNull(3))
{
item.EndDate = reader.GetDateTime(3).ToUniversalTime();
}
if (!reader.IsDBNull(4))
{
item.IsOffline = reader.GetBoolean(4);
}
if (!reader.IsDBNull(5))
{
item.ChannelId = reader.GetString(5);
}
var hasProgramAttributes = item as IHasProgramAttributes;
if (hasProgramAttributes != null)
{
if (!reader.IsDBNull(6))
{
hasProgramAttributes.IsMovie = reader.GetBoolean(6);
}
if (!reader.IsDBNull(7))
{
hasProgramAttributes.IsSports = reader.GetBoolean(7);
}
if (!reader.IsDBNull(8))
{
hasProgramAttributes.IsKids = reader.GetBoolean(8);
}
if (!reader.IsDBNull(9))
{
hasProgramAttributes.IsSeries = reader.GetBoolean(9);
}
if (!reader.IsDBNull(10))
{
hasProgramAttributes.IsLive = reader.GetBoolean(10);
}
if (!reader.IsDBNull(11))
{
hasProgramAttributes.IsNews = reader.GetBoolean(11);
}
if (!reader.IsDBNull(12))
{
hasProgramAttributes.IsPremiere = reader.GetBoolean(12);
}
if (!reader.IsDBNull(13))
{
hasProgramAttributes.EpisodeTitle = reader.GetString(13);
}
//.........这里部分代码省略.........
示例11: GetMediaStream
/// <summary>
/// Gets the chapter.
/// </summary>
/// <param name="reader">The reader.</param>
/// <returns>ChapterInfo.</returns>
private MediaStream GetMediaStream(IDataReader reader)
{
var item = new MediaStream
{
Index = reader.GetInt32(1)
};
item.Type = (MediaStreamType)Enum.Parse(typeof(MediaStreamType), reader.GetString(2), true);
if (!reader.IsDBNull(3))
{
item.Codec = reader.GetString(3);
}
if (!reader.IsDBNull(4))
{
item.Language = reader.GetString(4);
}
if (!reader.IsDBNull(5))
{
item.ChannelLayout = reader.GetString(5);
}
if (!reader.IsDBNull(6))
{
item.Profile = reader.GetString(6);
}
if (!reader.IsDBNull(7))
{
item.AspectRatio = reader.GetString(7);
}
if (!reader.IsDBNull(8))
{
item.Path = reader.GetString(8);
}
item.IsInterlaced = reader.GetBoolean(9);
if (!reader.IsDBNull(10))
{
item.BitRate = reader.GetInt32(10);
}
if (!reader.IsDBNull(11))
{
item.Channels = reader.GetInt32(11);
}
if (!reader.IsDBNull(12))
{
item.SampleRate = reader.GetInt32(12);
}
item.IsDefault = reader.GetBoolean(13);
item.IsForced = reader.GetBoolean(14);
item.IsExternal = reader.GetBoolean(15);
if (!reader.IsDBNull(16))
{
item.Width = reader.GetInt32(16);
}
if (!reader.IsDBNull(17))
{
item.Height = reader.GetInt32(17);
}
if (!reader.IsDBNull(18))
{
item.AverageFrameRate = reader.GetFloat(18);
}
if (!reader.IsDBNull(19))
{
item.RealFrameRate = reader.GetFloat(19);
}
if (!reader.IsDBNull(20))
{
item.Level = reader.GetFloat(20);
}
if (!reader.IsDBNull(21))
{
item.PixelFormat = reader.GetString(21);
}
if (!reader.IsDBNull(22))
{
item.BitDepth = reader.GetInt32(22);
}
//.........这里部分代码省略.........
示例12: PreencherAtributos
protected override void PreencherAtributos(IDataReader leitor, int inicioAtributosPagamento, int inicioAtributosEspecifico)
{
base.PreencherAtributos(leitor, inicioAtributosPagamento, inicioAtributosEspecifico);
peso = leitor.GetDouble(inicioAtributosEspecifico + 1);
paraFundir = leitor.GetBoolean(inicioAtributosEspecifico + 2);
multiplicador = leitor.GetDouble(inicioAtributosEspecifico + 3);
cotacao = leitor.GetDouble(inicioAtributosEspecifico + 4);
}
示例13: Read
private PrivacyDataSectionDto Read(IDataReader reader, ref bool alreadyRead)
{
int elementId = reader.GetInt32(0);
int pageId = reader.GetInt32(1);
bool isActive = reader.GetBoolean(2);
int sortSequence = reader.GetInt32(3);
bool isRequired = reader.GetBoolean(4);
string privacyHeader = GetString(reader, 5);
string privacyText = GetString(reader, 6);
string email = GetString(reader, 7);
string emailPreferences = GetString(reader, 8);
string emailPreferenceHtml = GetString(reader, 9);
string emailPreferenceText = GetString(reader, 10);
string post = GetString(reader, 11);
string phone = GetString(reader, 12);
string generalOptOut = GetString(reader, 13);
string yes = GetString(reader, 14);
string no = GetString(reader, 15);
string crmOfferCode = GetString(reader, 16);
bool prefilled = reader.GetBoolean(17);
PrivacyDataSectionDto retval = new PrivacyDataSectionDto(elementId, privacyHeader, isActive, pageId,
isRequired, privacyText, email, emailPreferences, emailPreferenceHtml, emailPreferenceText, post, phone,
generalOptOut, yes, no, crmOfferCode, prefilled);
return retval;
}
示例14: PopulateObjectFromReader
private static void PopulateObjectFromReader(VSALSalesOrderBase obj, IDataReader rdr)
{
obj.CustomerID = rdr.GetInt32(rdr.GetOrdinal(VSALSalesOrderFields.CustomerID));
obj.CustomerName = rdr.GetString(rdr.GetOrdinal(VSALSalesOrderFields.CustomerName));
if (!rdr.IsDBNull(rdr.GetOrdinal(VSALSalesOrderFields.Qty)))
{
obj.Qty = rdr.GetDecimal(rdr.GetOrdinal(VSALSalesOrderFields.Qty));
}
obj.SalesLineID = rdr.GetInt32(rdr.GetOrdinal(VSALSalesOrderFields.SalesLineID));
obj.TotalQty = rdr.GetDecimal(rdr.GetOrdinal(VSALSalesOrderFields.TotalQty));
obj.UnitPrice = rdr.GetDecimal(rdr.GetOrdinal(VSALSalesOrderFields.UnitPrice));
if (!rdr.IsDBNull(rdr.GetOrdinal(VSALSalesOrderFields.BatchNumber)))
{
obj.BatchNumber = rdr.GetString(rdr.GetOrdinal(VSALSalesOrderFields.BatchNumber));
}
if (!rdr.IsDBNull(rdr.GetOrdinal(VSALSalesOrderFields.ExpiryDate)))
{
obj.ExpiryDate = rdr.GetDateTime(rdr.GetOrdinal(VSALSalesOrderFields.ExpiryDate));
}
if (!rdr.IsDBNull(rdr.GetOrdinal(VSALSalesOrderFields.TaxValue)))
{
obj.TaxValue = rdr.GetDecimal(rdr.GetOrdinal(VSALSalesOrderFields.TaxValue));
}
obj.SalesHeaderID = rdr.GetInt32(rdr.GetOrdinal(VSALSalesOrderFields.SalesHeaderID));
obj.SalesDate = rdr.GetDateTime(rdr.GetOrdinal(VSALSalesOrderFields.SalesDate));
if (!rdr.IsDBNull(rdr.GetOrdinal(VSALSalesOrderFields.InvoiceNumber)))
{
obj.InvoiceNumber = rdr.GetString(rdr.GetOrdinal(VSALSalesOrderFields.InvoiceNumber));
}
if (!rdr.IsDBNull(rdr.GetOrdinal(VSALSalesOrderFields.InvoiceDate)))
{
obj.InvoiceDate = rdr.GetDateTime(rdr.GetOrdinal(VSALSalesOrderFields.InvoiceDate));
}
if (!rdr.IsDBNull(rdr.GetOrdinal(VSALSalesOrderFields.PaymentTypeID)))
{
obj.PaymentTypeID = rdr.GetInt32(rdr.GetOrdinal(VSALSalesOrderFields.PaymentTypeID));
}
obj.TotalDiscountRatio = rdr.GetDouble(rdr.GetOrdinal(VSALSalesOrderFields.TotalDiscountRatio));
if (!rdr.IsDBNull(rdr.GetOrdinal(VSALSalesOrderFields.TaxTypeName)))
{
obj.TaxTypeName = rdr.GetString(rdr.GetOrdinal(VSALSalesOrderFields.TaxTypeName));
}
obj.IsClosed = rdr.GetBoolean(rdr.GetOrdinal(VSALSalesOrderFields.IsClosed));
obj.IsVoid = rdr.GetBoolean(rdr.GetOrdinal(VSALSalesOrderFields.IsVoid));
if (!rdr.IsDBNull(rdr.GetOrdinal(VSALSalesOrderFields.FinalPrice)))
{
obj.FinalPrice = rdr.GetDecimal(rdr.GetOrdinal(VSALSalesOrderFields.FinalPrice));
}
if (!rdr.IsDBNull(rdr.GetOrdinal(VSALSalesOrderFields.ChequeNumber)))
{
obj.ChequeNumber = rdr.GetInt32(rdr.GetOrdinal(VSALSalesOrderFields.ChequeNumber));
}
obj.ProductName = rdr.GetString(rdr.GetOrdinal(VSALSalesOrderFields.ProductName));
if (!rdr.IsDBNull(rdr.GetOrdinal(VSALSalesOrderFields.ProductCode)))
{
obj.ProductCode = rdr.GetString(rdr.GetOrdinal(VSALSalesOrderFields.ProductCode));
}
if (!rdr.IsDBNull(rdr.GetOrdinal(VSALSalesOrderFields.IsAcceptBatch)))
{
obj.IsAcceptBatch = rdr.GetBoolean(rdr.GetOrdinal(VSALSalesOrderFields.IsAcceptBatch));
}
obj.UserFullName = rdr.GetString(rdr.GetOrdinal(VSALSalesOrderFields.UserFullName));
obj.ProductID = rdr.GetInt32(rdr.GetOrdinal(VSALSalesOrderFields.ProductID));
}
示例15: GetItem
private BaseItem GetItem(IDataReader reader)
{
var typeString = reader.GetString(0);
var type = _typeMapper.GetType(typeString);
if (type == null)
{
Logger.Debug("Unknown type {0}", typeString);
return null;
}
BaseItem item = null;
using (var stream = reader.GetMemoryStream(1))
{
try
{
item = _jsonSerializer.DeserializeFromStream(stream, type) as BaseItem;
}
catch (SerializationException ex)
{
Logger.ErrorException("Error deserializing item", ex);
}
if (item == null)
{
try
{
item = Activator.CreateInstance(type) as BaseItem;
}
catch
{
}
}
if (item == null)
{
return null;
}
}
if (!reader.IsDBNull(2))
{
var hasStartDate = item as IHasStartDate;
if (hasStartDate != null)
{
hasStartDate.StartDate = reader.GetDateTime(2).ToUniversalTime();
}
}
if (!reader.IsDBNull(3))
{
item.EndDate = reader.GetDateTime(3).ToUniversalTime();
}
if (!reader.IsDBNull(4))
{
item.IsOffline = reader.GetBoolean(4);
}
if (!reader.IsDBNull(5))
{
item.ChannelId = reader.GetString(5);
}
var hasProgramAttributes = item as IHasProgramAttributes;
if (hasProgramAttributes != null)
{
if (!reader.IsDBNull(6))
{
hasProgramAttributes.IsMovie = reader.GetBoolean(6);
}
if (!reader.IsDBNull(7))
{
hasProgramAttributes.IsSports = reader.GetBoolean(7);
}
if (!reader.IsDBNull(8))
{
hasProgramAttributes.IsKids = reader.GetBoolean(8);
}
if (!reader.IsDBNull(9))
{
hasProgramAttributes.IsSeries = reader.GetBoolean(9);
}
if (!reader.IsDBNull(10))
{
hasProgramAttributes.IsLive = reader.GetBoolean(10);
}
if (!reader.IsDBNull(11))
{
hasProgramAttributes.IsNews = reader.GetBoolean(11);
}
//.........这里部分代码省略.........