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


C# MySqlDataReader.GetBoolean方法代码示例

本文整理汇总了C#中MySql.Data.MySqlClient.MySqlDataReader.GetBoolean方法的典型用法代码示例。如果您正苦于以下问题:C# MySqlDataReader.GetBoolean方法的具体用法?C# MySqlDataReader.GetBoolean怎么用?C# MySqlDataReader.GetBoolean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MySql.Data.MySqlClient.MySqlDataReader的用法示例。


在下文中一共展示了MySqlDataReader.GetBoolean方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetInschrijvingFromDataReader

        protected Inschrijving GetInschrijvingFromDataReader(MySqlDataReader dataReader)
        {
            bool eetMee = dataReader.GetBoolean("eetMee");
            bool betaald = dataReader.GetBoolean("betaald");

            Inschrijving inschrijving = new Inschrijving { EetMee = eetMee, Betaald = betaald };

            return inschrijving;
        }
开发者ID:CVD95,项目名称:WebshopDierenwinkel,代码行数:9,代码来源:DatabaseController.cs

示例2: DBColumnToPyObject

        public static PyObject DBColumnToPyObject(int index, ref MySqlDataReader reader)
        {
            Type type = reader.GetFieldType(index);

            switch (type.Name)
            {
                case "String":
                    return new PyString(reader.GetString(index));
                case "UInt32":
                case "Int32":
                case "UInt16":
                case "Int16":
                case "SByte":
                case "Byte":
                    return new PyInt(reader.GetInt32(index));
                case "UInt64":
                case "Int64":
                    return new PyLongLong(reader.GetInt64(index));
                case "Byte[]":
                    return new PyBuffer((byte[])reader.GetValue(index));
                case "Double":
                    return new PyFloat(reader.GetDouble(index));
                case "Decimal":
                    return new PyFloat((double)reader.GetDecimal(index));
                case "Boolean":
                    return new PyBool(reader.GetBoolean(index));
                default:
                    Log.Error("Database", "Unhandled MySQL type " + type.Name);
                    break;
            }

            return null;
        }
开发者ID:Reve,项目名称:EVESharp,代码行数:33,代码来源:DBUtils.cs

示例3: GetGenreFromDataReader

 protected Genre GetGenreFromDataReader(MySqlDataReader dataReader)
 {
     string genreNaam = dataReader.GetString("genrenaam");
     int genreId = dataReader.GetInt32("genre_id");
     bool verslavend = dataReader.GetBoolean("verslavend");
     Genre genre = new Genre { ID = genreId, Naam = genreNaam, Verslavend = verslavend };
     return genre;
 }
开发者ID:CVD95,项目名称:WebshopDierenwinkel,代码行数:8,代码来源:DatabaseController.cs

示例4: Guild

        public Guild(MySqlDataReader reader, MySqlConnection con)
        {
            ID = reader.GetInt32("ID");
            Name = reader.GetString("GuildName");
               // _Password = (byte[])reader.GetValue("Password");
            _Password = new byte[12];
            AllowGuildWar = reader.GetBoolean("AllowGuildWar");
            Message = reader.GetString("GuildMessage");
            MessageCreateTime = reader.GetDateTime(8);
            MessageCreaterID = reader.GetInt32("CreaterID");
            CreateTime = DateTime.Now;//read later
            GuildMoney = reader.GetInt64("GuildMoney");

            Members = new List<GuildMember>();
            ThreadLocker = new object();
            GuildStore = new GuildStorage(this);
            Load();
        }
开发者ID:Dextan,项目名称:Estrella,代码行数:18,代码来源:Guild.cs

示例5: ReadClientData

        private Client ReadClientData(MySqlDataReader reader)
        {
            Client client = new Client();

            client.client_id = reader.GetInt32("client_id");
            client.client_name = reader.GetString("client_name");
            client.client_surname = reader.GetString("client_surname");
            client.client_email = reader.GetString("client_email");
            client.client_phone = !reader.IsDBNull(4) ? reader.GetString("client_phone") : null;
            client.client_birth_date = reader.GetDateTime("client_birth_date");
            client.client_member_from = reader.GetDateTime("client_member_from");
            client.client_member_to = !reader.IsDBNull(7) ? reader.GetDateTime("client_member_to") : DateTime.MinValue;
            client.client_street = !reader.IsDBNull(8) ? reader.GetString("client_street") : null;
            client.client_city = !reader.IsDBNull(9) ? reader.GetString("client_city") : null;
            client.client_zip = !reader.IsDBNull(10) ? reader.GetString("client_zip") : null;
            client.client_country = !reader.IsDBNull(11) ? reader.GetString("country") : null;
            client.client_isEmp = reader.GetBoolean("client_isEmp");
            client.client_is_active = reader.GetBoolean("client_is_active");
            client.client_login = reader.GetString("client_login");
            client.client_pass_hash = reader.GetString("client_pass_hash");
            client.client_last_act = !reader.IsDBNull(16) ? reader.GetDateTime("client_last_act") : DateTime.MinValue;

            return client;
        }
开发者ID:JiriHrba,项目名称:SAN_project,代码行数:24,代码来源:ClientTable.cs

示例6: LoadFromReader

 public void LoadFromReader(MySqlDataReader _reader)
 {
     m_id = _reader["id"].GetType() != typeof(System.DBNull) ? _reader.GetInt64("id") : 0;
     mc_id = false;
     m_title = _reader["title"].GetType() != typeof(System.DBNull) ? _reader.GetString("title") : "";
     mc_title = false;
     m_parent_id = _reader["parent_id"].GetType() != typeof(System.DBNull) ? _reader.GetInt64("parent_id") : 0;
     mc_parent_id = false;
     m_category_id = _reader["category_id"].GetType() != typeof(System.DBNull) ? _reader.GetInt64("category_id") : 0;
     mc_category_id = false;
     m_nested_category_id = _reader["nested_category_id"].GetType() != typeof(System.DBNull) ? _reader.GetInt64("nested_category_id") : 0;
     mc_nested_category_id = false;
     m_item_order = _reader["item_order"].GetType() != typeof(System.DBNull) ? _reader.GetInt64("item_order") : 0;
     mc_item_order = false;
     m_in_search = _reader["in_search"].GetType() != typeof(System.DBNull) ? _reader.GetBoolean("in_search") : false;
     mc_in_search = false;
     m_map_key = _reader["map_key"].GetType() != typeof(System.DBNull) ? _reader.GetString("map_key") : "";
     mc_map_key = false;
 }
开发者ID:seavan,项目名称:bewell-travel,代码行数:19,代码来源:territories.cs

示例7: LoadGameServerFromQuery

        /// <summary>
        /// Read server parameters from the standard database query column
        /// layout and construct and return a NWGameServer corresponding to the
        /// data in question.
        /// </summary>
        /// <param name="Reader">Supplies a reader containing the results of a
        /// query that correspond to the standard column set.</param>
        /// <returns>A NWGameServer object describing the current row.</returns>
        private NWGameServer LoadGameServerFromQuery(MySqlDataReader Reader)
        {
            NWGameServer Server = new NWGameServer();

            Server.ExpansionsMask = Reader.GetUInt32(1);
            Server.BuildNumber = Reader.GetUInt32(2);
            Server.ModuleName = Reader.GetString(3);
            Server.ServerName = Reader.GetString(4);
            Server.ActivePlayerCount = Reader.GetUInt32(5);
            Server.MaximumPlayerCount = Reader.GetUInt32(6);
            Server.LocalVault = Reader.GetBoolean(7);
            Server.LastHeartbeat = Reader.GetDateTime(8);
            Server.ServerAddress = Reader.GetString(9);
            Server.Online = Reader.GetBoolean(10);
            Server.PrivateServer = Reader.GetBoolean(11);
            Server.ModuleDescription = Reader.GetString(12);
            Server.ModuleUrl = Reader.GetString(13);
            Server.GameType = Reader.GetUInt32(14);
            Server.MinimumLevel = Reader.GetUInt32(15);
            Server.MaximumLevel = Reader.GetUInt32(16);
            Server.PVPLevel = Reader.GetUInt32(17);
            Server.PlayerPause = Reader.GetBoolean(18);
            Server.OnePartyOnly = Reader.GetBoolean(19);
            Server.ELCEnforced = Reader.GetBoolean(20);
            Server.ILREnforced = Reader.GetBoolean(21);
            Server.PWCUrl = Reader.GetString(22);
            Server.ServerDescription = Reader.GetString(23);

            return Server;
        }
开发者ID:jakkn,项目名称:nwn2dev-public,代码行数:38,代码来源:NWNMasterServerAPI.cs

示例8: getBool

 public static bool? getBool(MySqlDataReader dr, string column)
 {
     int ordinal = dr.GetOrdinal(column);
     if (dr.IsDBNull(ordinal))
     {
         return null;
     }
     else
     {
         return dr.GetBoolean(ordinal);
     }
 }
开发者ID:santoshpisipati,项目名称:you-global,代码行数:12,代码来源:DataAccess.cs

示例9: GetUserFromReader

        private static MembershipUser GetUserFromReader(MySqlDataReader reader)
        {
            int id_user = reader.GetInt32("id_user");
            string username = reader.GetString("userName");
            string email = reader.GetString("email");
            bool isApproved = reader.GetBoolean("approved");
            bool isLockedOut = reader.GetBoolean("locked");
            DateTime createdDate = reader.GetDateTime("creationDate");

            DateTime lastLoginDate = reader["lastLoginDate"] != DBNull.Value ? reader.GetDateTime("lastLoginDate") : DateTime.MinValue;
            DateTime lastActivityDate = reader["lastActivityDate"] != DBNull.Value ? reader.GetDateTime("lastActivityDate") : DateTime.MinValue;
            DateTime lastLockedDate = reader["lastLockedDate"] != DBNull.Value ? reader.GetDateTime("lastLockedDate") : DateTime.MinValue;
            DateTime lastPasswordChangedDate = reader["lastPasswordChangedDate"] != DBNull.Value ? reader.GetDateTime("lastPasswordChangedDate") : DateTime.MinValue;

            return new MembershipUser("PureMembershipProvider", username, null, email, null, null, isApproved,
                                      isLockedOut, createdDate, lastLoginDate, lastActivityDate, lastPasswordChangedDate,
                                      lastLockedDate);
            //return new PureMembershipUser(id_user, username, email, isApproved, isLockedOut,
            //    createdDate, lastLoginDate, lastActivityDate, lastPasswordChangedDate, lastLockedDate);
        }
开发者ID:yhnavein,项目名称:MySQLMembershipProvider,代码行数:20,代码来源:PureMembershipProvider.cs

示例10: MapLeague

 private static League MapLeague(MySqlDataReader dr)
 {
     return new League
         {
             Created = dr.GetDateTime("created"),
             CreatorUserId = dr.GetInt64("creatorUserId"),
             CreatorUserName = dr.GetString("creatorUserName"),
             Id = dr.GetInt64("id"),
             IsActive = dr.GetBoolean("active"),
             Name = dr.GetString("name"),
             OwnerUserId = dr.GetInt64("ownerUserId"),
             OwnerUserName = dr.GetString("ownerUserName"),
             Sport = (SportType) dr.GetInt32("sportId")
         };
 }
开发者ID:hecubu5,项目名称:sportpicks,代码行数:15,代码来源:LeagueRepository.cs

示例11: findByPersonnameAndPersonemail

        public void findByPersonnameAndPersonemail()
        {
            db = new Database();

            personQuery = new MySqlCommand();

            personQuery.Connection = db.Connection();

            personQuery.CommandText = "SELECT * FROM person WHERE personname = @Name AND personemail = @Email";
            personQuery.Prepare();

            personQuery.Parameters.AddWithValue("@Name", personname);
            personQuery.Parameters.AddWithValue("@Email", personemail);

            personResult = personQuery.ExecuteReader();

            while (personResult.Read())
            {
                if (!personResult.IsDBNull(0))
                {
                    idperson = personResult.GetInt32(0);
                }

                if (!personResult.IsDBNull(1))
                {
                    personname = personResult.GetString(1);
                }

                if (!personResult.IsDBNull(2))
                {
                    personemail = personResult.GetString(2);
                }
                else
                {
                    personemail = null;
                }

                if (!personResult.IsDBNull(3))
                {
                    personstate = personResult.GetBoolean(3);
                }
            }

            db.Close();
        }
开发者ID:JoseMariaAndrade,项目名称:VeneporteProject,代码行数:45,代码来源:Person.cs

示例12: GetUserFromReader

		//
		// GetUserFromReader
		//    A helper function that takes the current row from the MySqlDataReader
		//    and hydrates a MembershiUser from the values. Called by the 
		//    MembershipUser.GetUser implementation.
		//
		private MembershipUser GetUserFromReader(MySqlDataReader reader)
		{
			object providerUserKey = new Guid(reader.GetValue(0).ToString());
			string username = reader.IsDBNull(1) ? "" : reader.GetString(1);
			string email = reader.IsDBNull(2) ? "" : reader.GetString(2);
			string passwordQuestion = reader.IsDBNull(3) ? "" : reader.GetString(3);
			string comment = reader.IsDBNull(4) ? "" : reader.GetString(4);
			bool isApproved = reader.IsDBNull(5) ? false : reader.GetBoolean(5);
			bool isLockedOut = reader.IsDBNull(6) ? false : reader.GetBoolean(6);
			DateTime creationDate = reader.IsDBNull(7) ? DateTime.Now : reader.GetDateTime(7);
			DateTime lastLoginDate = reader.IsDBNull(8) ? DateTime.Now : reader.GetDateTime(8);
			DateTime lastActivityDate = reader.IsDBNull(9) ? DateTime.Now : reader.GetDateTime(9);
			DateTime lastPasswordChangedDate = reader.IsDBNull(10) ? DateTime.Now : reader.GetDateTime(10);
			DateTime lastLockedOutDate = reader.IsDBNull(11) ? DateTime.Now : reader.GetDateTime(11);

			return new MembershipUser(
				this.Name,
				username,
				providerUserKey,
				email,
				passwordQuestion,
				comment,
				isApproved,
				isLockedOut,
				creationDate,
				lastLoginDate,
				lastActivityDate,
				lastPasswordChangedDate,
				lastLockedOutDate
				);
		}
开发者ID:jdamsbo,项目名称:bevs.dk,代码行数:37,代码来源:MySQLMembershipProvider.cs

示例13: ProcessRow

 protected Blocked_timeslot ProcessRow(MySqlDataReader Reader, Blocked_timeslot blockedTimeSlot)
 {
     blockedTimeSlot.Daytime_id = Reader.GetInt32(0);
     blockedTimeSlot.Hardblock = Reader.GetBoolean(1);
     return blockedTimeSlot;
 }
开发者ID:PAZ-MI4Ie,项目名称:PAZ,代码行数:6,代码来源:BlockedTimeslotMapper.cs

示例14: findAll

        public void findAll()
        {
            db = new Database();

            persons.Clear();

            personQuery = new MySqlCommand();

            personQuery.Connection = db.Connection();

            personQuery.CommandText = "SELECT * FROM person ORDER BY personname ASC";

            personResult = personQuery.ExecuteReader();

            while (personResult.Read())
            {
                if (!personResult.IsDBNull(0))
                {
                    idperson = personResult.GetInt32(0);
                }

                if (!personResult.IsDBNull(1))
                {
                    personname = personResult.GetString(1);
                }

                if (!personResult.IsDBNull(2))
                {
                    personemail = personResult.GetString(2);
                }
                else
                {
                    personemail = null;
                }

                if (!personResult.IsDBNull(3))
                {
                    personstate = personResult.GetBoolean(3);
                }

                persons.Add(new Person { idperson = this.idperson, personname = this.personname, personemail = this.personemail, personstate = this.personstate });
            }

            db.Close();
        }
开发者ID:JoseMariaAndrade,项目名称:VeneporteProject,代码行数:45,代码来源:Person.cs

示例15: LoadFromReader

 public void LoadFromReader(MySqlDataReader _reader)
 {
     m_id = _reader["id"].GetType() != typeof(System.DBNull) ? _reader.GetInt64("id") : 0;
     mc_id = false;
     m_title = _reader["title"].GetType() != typeof(System.DBNull) ? _reader.GetString("title") : "";
     mc_title = false;
     m_url = _reader["url"].GetType() != typeof(System.DBNull) ? _reader.GetString("url") : "";
     mc_url = false;
     m_proto_name = _reader["proto_name"].GetType() != typeof(System.DBNull) ? _reader.GetString("proto_name") : "";
     mc_proto_name = false;
     m_order_number = _reader["order_number"].GetType() != typeof(System.DBNull) ? _reader.GetInt32("order_number") : 0;
     mc_order_number = false;
     m_show_gallery = _reader["show_gallery"].GetType() != typeof(System.DBNull) ? _reader.GetBoolean("show_gallery") : false;
     mc_show_gallery = false;
     m_show_map = _reader["show_map"].GetType() != typeof(System.DBNull) ? _reader.GetBoolean("show_map") : false;
     mc_show_map = false;
     m_show_in_anounce = _reader["show_in_anounce"].GetType() != typeof(System.DBNull) ? _reader.GetBoolean("show_in_anounce") : false;
     mc_show_in_anounce = false;
 }
开发者ID:seavan,项目名称:bewell-travel,代码行数:19,代码来源:fieldsets.cs


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