本文整理汇总了C#中MySql.Data.MySqlClient.MySqlDataReader.GetByte方法的典型用法代码示例。如果您正苦于以下问题:C# MySqlDataReader.GetByte方法的具体用法?C# MySqlDataReader.GetByte怎么用?C# MySqlDataReader.GetByte使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MySql.Data.MySqlClient.MySqlDataReader
的用法示例。
在下文中一共展示了MySqlDataReader.GetByte方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadFromDB
public void LoadFromDB(MySqlDataReader reader)
{
if (reader.Read())
{
RegDate = reader.GetDateTime(0);
LastLoginDate = reader.GetDateTime(1);
ContinuousCount = reader.GetByte(2);
DailyCount = reader.GetByte(3);
}
}
示例2: ds2browse
//
//-------------------------------------------------------------------------------------------------
//
public bool ds2browse(string browse_type_in, string browse_category_in, string browse_actor_in,
string browse_title_in, int batch_size_in, int customerid_out, ref int rows_returned,
ref int[] prod_id_out, ref string[] title_out, ref string[] actor_out, ref decimal[] price_out,
ref int[] special_out, ref int[] common_prod_id_out, ref double rt)
{
// Products table: PROD_ID INT, CATEGORY TINYINT, TITLE VARCHAR(50), ACTOR VARCHAR(50),
// PRICE DECIMAL(12,2), SPECIAL TINYINT, COMMON_PROD_ID INT
int i_row;
int[] category_out = new int[GlobalConstants.MAX_ROWS];
#if (USE_WIN32_TIMER)
long ctr0 = 0, ctr = 0, freq = 0;
#else
TimeSpan TS = new TimeSpan();
DateTime DT0;
#endif
switch(browse_type_in)
{
case "title":
db_query = "select * from PRODUCTS where MATCH (TITLE) AGAINST ('" + browse_title_in + "') LIMIT " +
batch_size_in + ";";
break;
case "actor":
db_query = "select * from PRODUCTS where MATCH (ACTOR) AGAINST ('" + browse_actor_in + "') LIMIT " +
batch_size_in + ";";
break;
case "category":
db_query="select * from PRODUCTS where CATEGORY = " + Convert.ToInt32(browse_category_in) +
" and SPECIAL=1 LIMIT " + batch_size_in + ";";
break;
}
Browse = new MySqlCommand(db_query, objConn);
#if (USE_WIN32_TIMER)
QueryPerformanceFrequency(ref freq); // obtain system freq (ticks/sec)
QueryPerformanceCounter(ref ctr0); // Start response time clock
#else
DT0 = DateTime.Now;
#endif
try
{
Rdr = Browse.ExecuteReader();
i_row = 0;
if (!Rdr.HasRows) // No rows returned
{
//Console.WriteLine("No DVDs Found");
}
else // Rows returned
{
while (Rdr.Read())
{
prod_id_out[i_row] = Rdr.GetInt32(0);
category_out[i_row] = Rdr.GetByte(1);
title_out[i_row] = Rdr.GetString(2);
actor_out[i_row] = Rdr.GetString(3);
price_out[i_row] = Rdr.GetDecimal(4);
special_out[i_row] = Rdr.GetByte(5);
common_prod_id_out[i_row] = Rdr.GetInt32(6);
++i_row;
}
}
Rdr.Close();
rows_returned = i_row;
}
catch (MySqlException e)
{
Console.WriteLine("Thread {0}: Error in Browse: {1}", Thread.CurrentThread.Name, e.Message);
return(false);
}
// Console.WriteLine("Thread {0}: Calling Browse w/ browse_type= {1} batch_size_in= {2} category= {3}" +
// " title= {4} actor= {5}", Thread.CurrentThread.Name, browse_type_in, batch_size_in, browse_category_in,
// browse_title_in, browse_actor_in);
#if (USE_WIN32_TIMER)
QueryPerformanceCounter(ref ctr); // Stop response time clock
rt = (ctr - ctr0)/(double) freq; // Calculate response time
#else
TS = DateTime.Now - DT0;
rt = TS.TotalSeconds; // Calculate response time
#endif
return(true);
}
示例3: LoadFromReader
public void LoadFromReader(MySqlDataReader _reader)
{
m_id = _reader["id"].GetType() != typeof(System.DBNull) ? _reader.GetInt64("id") : 0;
mc_id = false;
m_entity_id = _reader["entity_id"].GetType() != typeof(System.DBNull) ? _reader.GetInt64("entity_id") : 0;
mc_entity_id = false;
m_proto_name = _reader["proto_name"].GetType() != typeof(System.DBNull) ? _reader.GetString("proto_name") : "";
mc_proto_name = false;
m_month = _reader["month"].GetType() != typeof(System.DBNull) ? _reader.GetByte("month") : (byte)0;
mc_month = false;
m_price = _reader["price"].GetType() != typeof(System.DBNull) ? _reader.GetFloat("price") : (double)0;
mc_price = false;
m_comment = _reader["comment"].GetType() != typeof(System.DBNull) ? _reader.GetString("comment") : "";
mc_comment = false;
}
示例4: toObject
private Character toObject(MySqlDataReader reader)
{
Character character = new Character();
character.Id = reader.GetUInt32(0);
character.Slot = reader.GetByte(2);
character.Name = reader.GetString(3);
character.Faction = reader.GetByte(4);
character.Gender = reader.GetByte(5);
character.Rank = reader.GetUInt32(6);
character.Money = reader.GetUInt32(7);
character.Threat = reader.GetByte(8);
character.Playtime = reader.GetUInt32(9);
character.Clan = reader.GetString(10);
character.Version = reader.GetUInt32(11);
character.Appearence = reader.GetString(12);
character.Custom = reader.GetString(13);
character.WorldId = reader.GetUInt32(14);
return character;
}
示例5: getThreat
private Byte getThreat(MySqlDataReader reader)
{
Byte threat = reader.GetByte(8);
return threat;
}
示例6: getFaction
private Byte getFaction(MySqlDataReader reader)
{
Byte faction = reader.GetByte(4);
return faction;
}
示例7: _readArchiveMedia
private static ArchiveMedia _readArchiveMedia(MySqlDataReader dataReader, ArchiveDirectory dir)
{
byte typVideo = dataReader.IsDBNull(dataReader.GetOrdinal("typVideo")) ? (byte)0 : dataReader.GetByte("typVideo");
ArchiveMedia media = new ArchiveMedia()
{
idPersistentMedia = dataReader.GetUInt64("idArchiveMedia"),
Directory = dir,
};
_mediaReadFields(dataReader, media);
ThreadPool.QueueUserWorkItem(o => media.Verify());
return media;
}
示例8: getOnlineStatus
private Byte getOnlineStatus(MySqlDataReader reader)
{
Byte online = reader.GetByte(3);
return online;
}
示例9: getLfgStatus
private Byte getLfgStatus(MySqlDataReader reader)
{
Byte lfg = reader.GetByte(4);
return lfg;
}
示例10: getGrpStatus
private Byte getGrpStatus(MySqlDataReader reader)
{
Byte grpstatus = reader.GetByte(5);
return grpstatus;
}
示例11: getGrpPubStatus
private Byte getGrpPubStatus(MySqlDataReader reader)
{
Byte grppub = reader.GetByte(6);
return grppub;
}
示例12: getGrpInvStatus
private Byte getGrpInvStatus(MySqlDataReader reader)
{
Byte grpinv = reader.GetByte(7);
return grpinv;
}
示例13: getDistrictType
private Byte getDistrictType(MySqlDataReader reader)
{
Byte type = reader.GetByte(2);
return type;
}
示例14: getDistrictID
private Byte getDistrictID(MySqlDataReader reader)
{
Byte disid = reader.GetByte(1);
return disid;
}
示例15: _EventRead
private static Event _EventRead(Engine engine, MySqlDataReader dataReader)
{
Event aEvent = new Event(engine);
uint flags = dataReader.IsDBNull(dataReader.GetOrdinal("flagsEvent")) ? 0 : dataReader.GetUInt32("flagsEvent");
aEvent._idRundownEvent = dataReader.GetUInt64("idRundownEvent");
aEvent._layer = (VideoLayer)dataReader.GetSByte("Layer");
aEvent._eventType = (TEventType)dataReader.GetByte("typEvent");
aEvent._startType = (TStartType)dataReader.GetByte("typStart");
aEvent._scheduledTime = _readDateTimeField(dataReader, "ScheduledTime");
aEvent._duration = dataReader.IsDBNull(dataReader.GetOrdinal("Duration")) ? default(TimeSpan) : aEvent.Engine.AlignTimeSpan(dataReader.GetTimeSpan("Duration"));
aEvent._scheduledDelay = dataReader.IsDBNull(dataReader.GetOrdinal("ScheduledDelay")) ? default(TimeSpan) : aEvent.Engine.AlignTimeSpan(dataReader.GetTimeSpan("ScheduledDelay"));
aEvent._scheduledTC = dataReader.IsDBNull(dataReader.GetOrdinal("ScheduledTC")) ? TimeSpan.Zero : dataReader.GetTimeSpan("ScheduledTC");
aEvent._mediaGuid = (dataReader.IsDBNull(dataReader.GetOrdinal("MediaGuid"))) ? Guid.Empty : dataReader.GetGuid("MediaGuid");
aEvent._eventName = dataReader.IsDBNull(dataReader.GetOrdinal("EventName")) ? default(string) : dataReader.GetString("EventName");
var psb = dataReader.GetByte("PlayState");
aEvent._playState = (TPlayState)psb;
if (aEvent._playState == TPlayState.Playing || aEvent._playState == TPlayState.Paused)
aEvent._playState = TPlayState.Aborted;
if (aEvent._playState == TPlayState.Fading)
aEvent._playState = TPlayState.Played;
aEvent._startTime = _readDateTimeField(dataReader, "StartTime");
aEvent._startTC = dataReader.IsDBNull(dataReader.GetOrdinal("StartTC")) ? TimeSpan.Zero : dataReader.GetTimeSpan("StartTC");
aEvent._requestedStartTime = dataReader.IsDBNull(dataReader.GetOrdinal("RequestedStartTime")) ? null : (TimeSpan?)dataReader.GetTimeSpan("RequestedStartTime");
aEvent._transitionTime = dataReader.IsDBNull(dataReader.GetOrdinal("TransitionTime")) ? default(TimeSpan) : dataReader.GetTimeSpan("TransitionTime");
aEvent._transitionType = (TTransitionType)dataReader.GetByte("typTransition");
aEvent._audioVolume = dataReader.IsDBNull(dataReader.GetOrdinal("AudioVolume")) ? 0 : dataReader.GetDecimal("AudioVolume");
aEvent._idProgramme = dataReader.IsDBNull(dataReader.GetOrdinal("idProgramme")) ? 0 : dataReader.GetUInt64("idProgramme");
aEvent._idAux = dataReader.IsDBNull(dataReader.GetOrdinal("IdAux")) ? default(string) : dataReader.GetString("IdAux");
aEvent._enabled = (flags & (1 << 0)) != 0;
aEvent._hold = (flags & (1 << 1)) != 0;
EventGPI.FromUInt64(ref aEvent._gPI, (flags >> 4) & EventGPI.Mask);
aEvent._nextLoaded = false;
return aEvent;
}