当前位置: 首页>>代码示例>>C#>>正文


C# MySqlDataReader.GetByte方法代码示例

本文整理汇总了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);
     }
 }
开发者ID:SyncZone,项目名称:IndieAPI,代码行数:10,代码来源:LoginCounter.cs

示例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);
        }
开发者ID:wmkhairi,项目名称:pgsqlds2,代码行数:91,代码来源:ds2mysqlfns.cs

示例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;
 }
开发者ID:seavan,项目名称:bewell-travel,代码行数:15,代码来源:prices.cs

示例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;
 }
开发者ID:harleyknd1,项目名称:rAPB,代码行数:19,代码来源:Characters.cs

示例5: getThreat

 private Byte getThreat(MySqlDataReader reader)
 {
     Byte threat = reader.GetByte(8);
     return threat;
 }
开发者ID:harleyknd1,项目名称:rAPB,代码行数:5,代码来源:ASK_WORLD_ENTER.cs

示例6: getFaction

 private Byte getFaction(MySqlDataReader reader)
 {
     Byte faction = reader.GetByte(4);
     return faction;
 }
开发者ID:harleyknd1,项目名称:rAPB,代码行数:5,代码来源:ASK_WORLD_ENTER.cs

示例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;
 }
开发者ID:jstarpl,项目名称:PlayoutAutomation,代码行数:12,代码来源:DatabaseConnector.cs

示例8: getOnlineStatus

 private Byte getOnlineStatus(MySqlDataReader reader)
 {
     Byte online = reader.GetByte(3);
     return online;
 }
开发者ID:harleyknd1,项目名称:rAPB,代码行数:5,代码来源:ANS_FRIENDLIST_ADD.cs

示例9: getLfgStatus

 private Byte getLfgStatus(MySqlDataReader reader)
 {
     Byte lfg = reader.GetByte(4);
     return lfg;
 }
开发者ID:harleyknd1,项目名称:rAPB,代码行数:5,代码来源:ANS_FRIENDLIST_ADD.cs

示例10: getGrpStatus

 private Byte getGrpStatus(MySqlDataReader reader)
 {
     Byte grpstatus = reader.GetByte(5);
     return grpstatus;
 }
开发者ID:harleyknd1,项目名称:rAPB,代码行数:5,代码来源:ANS_FRIENDLIST_ADD.cs

示例11: getGrpPubStatus

 private Byte getGrpPubStatus(MySqlDataReader reader)
 {
     Byte grppub = reader.GetByte(6);
     return grppub;
 }
开发者ID:harleyknd1,项目名称:rAPB,代码行数:5,代码来源:ANS_FRIENDLIST_ADD.cs

示例12: getGrpInvStatus

 private Byte getGrpInvStatus(MySqlDataReader reader)
 {
     Byte grpinv = reader.GetByte(7);
     return grpinv;
 }
开发者ID:harleyknd1,项目名称:rAPB,代码行数:5,代码来源:ANS_FRIENDLIST_ADD.cs

示例13: getDistrictType

 private Byte getDistrictType(MySqlDataReader reader)
 {
     Byte type = reader.GetByte(2);
     return type;
 }
开发者ID:harleyknd1,项目名称:rAPB,代码行数:5,代码来源:ANS_FRIENDLIST_ADD.cs

示例14: getDistrictID

 private Byte getDistrictID(MySqlDataReader reader)
 {
     Byte disid = reader.GetByte(1);
     return disid;
 }
开发者ID:harleyknd1,项目名称:rAPB,代码行数:5,代码来源:ANS_FRIENDLIST_ADD.cs

示例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;
 }
开发者ID:jstarpl,项目名称:PlayoutAutomation,代码行数:34,代码来源:DatabaseConnector.cs


注:本文中的MySql.Data.MySqlClient.MySqlDataReader.GetByte方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。