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


C# SqlDataReader.GetBoolean方法代码示例

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


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

示例1: MakeViewAuditoriaListaVerificacionDetalleCross

        /// <summary>
        /// Creates a new instance of the ViewAuditoriaListaVerificacionDetalleCross class and populates it with data from the specified SqlDataReader.
        /// </summary>
        private static ViewAuditoriaListaVerificacionDetalleCrossInfo MakeViewAuditoriaListaVerificacionDetalleCross(SqlDataReader dataReader)
        {
            ViewAuditoriaListaVerificacionDetalleCrossInfo viewAuditoriaListaVerificacionDetalleCross = new ViewAuditoriaListaVerificacionDetalleCrossInfo();

            if (dataReader.IsDBNull(AuditoriaListaVerificacionDetalleCargoId) == false)
                viewAuditoriaListaVerificacionDetalleCross.AuditoriaListaVerificacionDetalleCargoId = dataReader.GetInt32(AuditoriaListaVerificacionDetalleCargoId);
            if (dataReader.IsDBNull(AuditoriaListaVerificacionDetalleId) == false)
                viewAuditoriaListaVerificacionDetalleCross.AuditoriaListaVerificacionDetalleId = dataReader.GetInt32(AuditoriaListaVerificacionDetalleId);
            if (dataReader.IsDBNull(AuditoriaListaVerificacionId) == false)
                viewAuditoriaListaVerificacionDetalleCross.AuditoriaListaVerificacionId = dataReader.GetInt32(AuditoriaListaVerificacionId);
            if (dataReader.IsDBNull(CargoId) == false)
                viewAuditoriaListaVerificacionDetalleCross.CargoId = dataReader.GetInt32(CargoId);
            if (dataReader.IsDBNull(Cargo) == false)
                viewAuditoriaListaVerificacionDetalleCross.Cargo = dataReader.GetString(Cargo);
            if (dataReader.IsDBNull(Activo) == false)
                viewAuditoriaListaVerificacionDetalleCross.Activo = dataReader.GetBoolean(Activo);
            if (dataReader.IsDBNull(AuditoriaPunto) == false)
                viewAuditoriaListaVerificacionDetalleCross.AuditoriaPunto = dataReader.GetString(AuditoriaPunto);
            if (dataReader.IsDBNull(AuditoriaControl) == false)
                viewAuditoriaListaVerificacionDetalleCross.AuditoriaControl = dataReader.GetString(AuditoriaControl);
            if (dataReader.IsDBNull(PuntajeRequerido) == false)
                viewAuditoriaListaVerificacionDetalleCross.PuntajeRequerido = dataReader.GetDecimal(PuntajeRequerido);
            if (dataReader.IsDBNull(Empresa) == false)
                viewAuditoriaListaVerificacionDetalleCross.Empresa = dataReader.GetString(Empresa);
            if (dataReader.IsDBNull(Orden) == false)
                viewAuditoriaListaVerificacionDetalleCross.Orden = dataReader.GetByte(Orden);

            return viewAuditoriaListaVerificacionDetalleCross;
        }
开发者ID:Avaruz,项目名称:SGC,代码行数:32,代码来源:ViewAuditoriaListaVerificacionDetalleCrossDb.cs

示例2: MakeViewSeguridadUsuario

        /// <summary>
        /// Creates a new instance of the ViewSeguridadUsuario class and populates it with data from the specified SqlDataReader.
        /// </summary>
        private static ViewSeguridadUsuarioInfo MakeViewSeguridadUsuario(SqlDataReader dataReader)
        {
            ViewSeguridadUsuarioInfo viewSeguridadUsuario = new ViewSeguridadUsuarioInfo();

            if (dataReader.IsDBNull(SeguridadUsuarioId) == false)
                viewSeguridadUsuario.SeguridadUsuarioId = dataReader.GetInt32(SeguridadUsuarioId);
            if (dataReader.IsDBNull(SeguridadRolId) == false)
                viewSeguridadUsuario.SeguridadRolId = dataReader.GetInt32(SeguridadRolId);
            if (dataReader.IsDBNull(Rol) == false)
                viewSeguridadUsuario.Rol = dataReader.GetString(Rol);
            if (dataReader.IsDBNull(NombreUsuario) == false)
                viewSeguridadUsuario.NombreUsuario = dataReader.GetString(NombreUsuario);
            if (dataReader.IsDBNull(Nombres) == false)
                viewSeguridadUsuario.Nombres = dataReader.GetString(Nombres);
            if (dataReader.IsDBNull(Apellidos) == false)
                viewSeguridadUsuario.Apellidos = dataReader.GetString(Apellidos);
            if (dataReader.IsDBNull(PaswordHash) == false)
                viewSeguridadUsuario.PaswordHash = dataReader.GetString(PaswordHash);
            if (dataReader.IsDBNull(Salt) == false)
                viewSeguridadUsuario.salt = dataReader.GetString(Salt);
            if (dataReader.IsDBNull(Activo) == false)
                viewSeguridadUsuario.Activo = dataReader.GetBoolean(Activo);
            if (dataReader.IsDBNull(NombreCompleto) == false)
                viewSeguridadUsuario.NombreCompleto = dataReader.GetString(NombreCompleto);

            return viewSeguridadUsuario;
        }
开发者ID:Avaruz,项目名称:SGC,代码行数:30,代码来源:ViewSeguridadUsuarioDb.cs

示例3: GetModelBySDR

 /// <summary>
 /// 根据sqldatareader进行获取模型
 /// </summary>
 /// <param name="sdr"></param>
 /// <returns></returns>
 public T_Member GetModelBySDR(SqlDataReader sdr)
 {
     T_Member t_m = null;
     if (sdr.Read())
     {
         t_m = new T_Member();
         t_m.F_Id = sdr.GetInt32(0);
         t_m.F_Email = sdr.GetString(1);
         t_m.F_Password = sdr.GetString(2);
         t_m.F_Sex = sdr.GetBoolean(3);
         t_m.F_NickName = sdr.GetString(4);
         t_m.F_Headpic = sdr.GetString(5);
         t_m.F_SecurityPassWord = sdr.GetString(6);
         t_m.F_Alipay = sdr.GetString(7);
         t_m.F_Issues = sdr.GetString(8);
         t_m.F_Answer = sdr.GetString(9);
         t_m.F_InitPassWord = sdr.GetString(10);
         t_m.F_Mobile = sdr.GetString(11);
         t_m.F_QQ = sdr.GetString(12);
         t_m.F_Level = sdr.GetInt32(13);
         t_m.F_Gold = sdr.GetInt32(14);
         t_m.F_Diamond = sdr.GetInt32(15);
         t_m.F_VIP = sdr.GetBoolean(16);
         t_m.F_KEY = sdr.GetString(17);
         t_m.F_Status = sdr.GetInt32(18);
         t_m.F_CreateDate = sdr.GetDateTime(19);
     }
     return t_m;
 }
开发者ID:cj1324,项目名称:hanchenproject,代码行数:34,代码来源:Manage_T_Member.cs

示例4: CheckSalesPersonLogIn

 // CHECK IF SALES PERSON EXIST IN DATBASE
 public static string CheckSalesPersonLogIn(SqlDataReader dr)
 {
     bool noExist = true;
     bool isActive = true;
     string clear = null;
     while (dr.Read())
     {
         clear = dr.GetString(0);
         isActive = dr.GetBoolean(5);
         noExist = false;
     }
     if (!isActive)
     {
         MessageBox.Show("Sorry, you are fired!", "LOL", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return null;
     }
     else if (noExist)
     {
         MessageBox.Show("Not in the register.", "Unregistered Sales Person", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return null;
     }
     else
     {
         return clear;
     }
 }
开发者ID:JoelPennegard,项目名称:sysa14affairs,代码行数:27,代码来源:Utility.cs

示例5: PopulateCategory

        public void PopulateCategory(SqlDataReader _dtr, Category obj)
        {
            int columnIndex = 0;
            columnIndex = _dtr.GetOrdinal(CategoryDataMapper.CN_ID);
            if (!_dtr.IsDBNull(columnIndex))
            {
                obj.ID = _dtr.GetInt32((columnIndex));
            }
            columnIndex = _dtr.GetOrdinal(CategoryDataMapper.CN_NAME);
            if (!_dtr.IsDBNull(columnIndex))
            {
                obj.Name = _dtr.GetString((columnIndex));
            }
            columnIndex = _dtr.GetOrdinal(CategoryDataMapper.CN_DESCRIPTION);
            if (!_dtr.IsDBNull(columnIndex))
            {
                obj.Description = _dtr.GetString((columnIndex));
            }
            columnIndex = _dtr.GetOrdinal(CategoryDataMapper.CN_TYPE);
            if (!_dtr.IsDBNull(columnIndex))
            {
                obj.Type = (TG.ExpressCMS.DataLayer.Enums.RootEnums.CategoryType)_dtr.GetInt32((columnIndex));
            }
            columnIndex = _dtr.GetOrdinal(CategoryDataMapper.CN_ATTRIBUTES);
            if (!_dtr.IsDBNull(columnIndex))
            {
                obj.Attributes = _dtr.GetString((columnIndex));
            }
            columnIndex = _dtr.GetOrdinal(CategoryDataMapper.CN_ISDELETED);
            if (!_dtr.IsDBNull(columnIndex))
            {
                obj.IsDeleted = _dtr.GetBoolean((columnIndex));
            }
            columnIndex = _dtr.GetOrdinal(CategoryDataMapper.CN_XSL_ID);
            if (!_dtr.IsDBNull(columnIndex))
            {
                obj.XslID = _dtr.GetInt32((columnIndex));
            }
            columnIndex = _dtr.GetOrdinal(CategoryDataMapper.CN_image);
            if (!_dtr.IsDBNull(columnIndex))
            {
                obj.Image = _dtr.GetString((columnIndex));
            }

            columnIndex = _dtr.GetOrdinal(CategoryDataMapper.CN_LANGUAGE_ID);
            if (!_dtr.IsDBNull(columnIndex))
            {
                obj.LanguageID = _dtr.GetInt32((columnIndex));
            }

            columnIndex = _dtr.GetOrdinal(CategoryDataMapper.CN_HASH);
            if (!_dtr.IsDBNull(columnIndex))
            {
                obj.Hash = _dtr.GetString((columnIndex));
            }
        }
开发者ID:yalhami,项目名称:eXpresso,代码行数:56,代码来源:DataMapperBase.cs

示例6: ProcessSqlResult

 protected override Exception ProcessSqlResult(SqlDataReader reader)
 {
     Exception nextResultSet = StoreUtilities.GetNextResultSet(base.InstancePersistenceCommand.Name, reader);
     if ((nextResultSet == null) && (!reader.GetBoolean(1) || (base.ProcessSqlResult(reader) != null)))
     {
         base.Store.UpdateEventStatus(false, InstancePersistenceEvent<HasRunnableWorkflowEvent>.Value);
         base.StoreLock.InstanceDetectionTask.ResetTimer(false);
     }
     return nextResultSet;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:10,代码来源:TryLoadRunnableWorkflowAsyncResult.cs

示例7: GetDBBool

 private bool GetDBBool(SqlDataReader reader, string columnName)
 {
     try
     {
         int ordinal = reader.GetOrdinal(columnName);
         return reader.IsDBNull(ordinal) ? false : reader.GetBoolean(ordinal);
     }
     catch (IndexOutOfRangeException)
     {
         return false;
     }
 }
开发者ID:LimeyJohnson,项目名称:Agave,代码行数:12,代码来源:DataAccess.cs

示例8: FillAuthor

        private Author FillAuthor(SqlDataReader reader)
        {
            var author = new Author();
            author.Id = reader.GetInt32(0);
            author.Name = reader.GetString(1);
            author.Email = reader.GetString(2);
            author.Password = reader.GetString(3);
            author.IsActive = reader.GetBoolean(4);
            author.DateCreated = reader.GetDateTime(5);

            return author;
        }
开发者ID:jordiruiz,项目名称:Joomiz.Blog,代码行数:12,代码来源:AuthorRepository.cs

示例9: FillPost

        private Post FillPost(SqlDataReader reader)
        {
            var post = new Post();

            post.Id = reader.GetInt32(0);
            post.Author = new Author();
            post.Author.Id = reader.GetInt32(1);
            post.Title = reader.GetValueOrDefault<string>(2);
            post.Body = reader.GetValueOrDefault<string>(3);
            post.IsPublished = reader.GetBoolean(4);
            post.DateCreated = reader.GetDateTime(5);

            return post;
        }
开发者ID:jordiruiz,项目名称:Joomiz.Blog,代码行数:14,代码来源:PostRepository.cs

示例10: CreateNotification

 private Notification CreateNotification(SqlDataReader reader)
 {
     return new Notification
     {
         ID = reader.GetGuid(reader.GetOrdinal("NotificationID")),
         LanguageCode = GetString(reader, "LanguageCode"),
         Subject = GetString(reader, "Subject"),
         TypeKey = GetString(reader, "TypeKey"),
         Dispatched = reader.GetBoolean(reader.GetOrdinal("Dispatched")),
         Parameter = new JavaScriptSerializer().Deserialize<Dictionary<string, string>>(
             GetString(reader, "Parameter")
         )
     };
 }
开发者ID:jbinder,项目名称:dragon,代码行数:14,代码来源:SqlNotificationStore.cs

示例11: LoadEntity

        protected override DomainObject LoadEntity(int Id, SqlDataReader res)
        {
            if (res.Read())
            {

                bool userIsAdmin = res.GetBoolean(2);
                if (userIsAdmin)
                    return _adminMapper.LoadUser(Id, res.GetString(1),res.GetString(3));
                else
                    return _nUserMapper.LoadUser(Id, res.GetString(1));
            }

            else
                return null;
        }
开发者ID:erdonet,项目名称:EnterpriseDesignPatterns,代码行数:15,代码来源:UserMapper.cs

示例12: FillModelFrom

 private static void FillModelFrom(SqlDataReader reader, UserInfoModel obj)
 {
     #region
     if (reader != null && !reader.IsClosed)
     {
         obj.UserID = reader.IsDBNull(reader.GetOrdinal("UserID")) ? 0 : reader.GetInt64(reader.GetOrdinal("UserID"));
         obj.Email = reader.IsDBNull(reader.GetOrdinal("Email")) ? String.Empty : reader.GetString(reader.GetOrdinal("Email"));
         obj.LoginName = reader.IsDBNull(reader.GetOrdinal("LoginName")) ? String.Empty : reader.GetString(reader.GetOrdinal("LoginName"));
         obj.Password = reader.IsDBNull(reader.GetOrdinal("Password")) ? String.Empty : reader.GetString(reader.GetOrdinal("Password"));
         obj.Sex = reader.IsDBNull(reader.GetOrdinal("Sex")) ? false : reader.GetBoolean(reader.GetOrdinal("Sex"));
         obj.Mobile = reader.IsDBNull(reader.GetOrdinal("Mobile")) ? String.Empty : reader.GetString(reader.GetOrdinal("Mobile"));
         obj.RealName = reader.IsDBNull(reader.GetOrdinal("RealName")) ? String.Empty : reader.GetString(reader.GetOrdinal("RealName"));
     }
     #endregion
 }
开发者ID:yesnoba,项目名称:take-ticket-project,代码行数:15,代码来源:UserInfoDAL.cs

示例13: CheckAdmin

 public static bool CheckAdmin(SqlDataReader dr)
 {
     bool isAdmin = true;
     while (dr.Read())
     {
         isAdmin = dr.GetBoolean(4);
     }
     if (isAdmin)
     {
         return true;
     }
     else
     {
         return false;
     }
 }
开发者ID:JoelPennegard,项目名称:sysa14affairs,代码行数:16,代码来源:Utility2.cs

示例14: ProcessSqlResult

        protected override Exception ProcessSqlResult(SqlDataReader reader)
        {
            Exception exception = StoreUtilities.GetNextResultSet(this.InstancePersistenceCommand.Name, reader);

            if (exception == null)
            {
                bool runnableInstanceFound = reader.GetBoolean(1);
                if (!runnableInstanceFound || base.ProcessSqlResult(reader) != null)
                {
                    base.Store.UpdateEventStatus(false, HasRunnableWorkflowEvent.Value);
                    base.StoreLock.InstanceDetectionTask.ResetTimer(false);
                }
            }

            return exception;
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:16,代码来源:TryLoadRunnableWorkflowAsyncResult.cs

示例15: MakeViewAuditoriaListaVerificacionDetalleCargo

        /// <summary>
        /// Creates a new instance of the ViewAuditoriaListaVerificacionDetalleCargo class and populates it with data from the specified SqlDataReader.
        /// </summary>
        private static ViewAuditoriaListaVerificacionDetalleCargoInfo MakeViewAuditoriaListaVerificacionDetalleCargo(SqlDataReader dataReader)
        {
            ViewAuditoriaListaVerificacionDetalleCargoInfo viewAuditoriaListaVerificacionDetalleCargo = new ViewAuditoriaListaVerificacionDetalleCargoInfo();

            if (dataReader.IsDBNull(AuditoriaListaVerificacionDetalleCargoId) == false)
                viewAuditoriaListaVerificacionDetalleCargo.AuditoriaListaVerificacionDetalleCargoId = dataReader.GetInt32(AuditoriaListaVerificacionDetalleCargoId);
            if (dataReader.IsDBNull(AuditoriaListaVerificacionDetalleId) == false)
                viewAuditoriaListaVerificacionDetalleCargo.AuditoriaListaVerificacionDetalleId = dataReader.GetInt32(AuditoriaListaVerificacionDetalleId);
            if (dataReader.IsDBNull(CargoId) == false)
                viewAuditoriaListaVerificacionDetalleCargo.CargoId = dataReader.GetInt32(CargoId);
            if (dataReader.IsDBNull(Cargo) == false)
                viewAuditoriaListaVerificacionDetalleCargo.Cargo = dataReader.GetString(Cargo);
            if (dataReader.IsDBNull(Activo) == false)
                viewAuditoriaListaVerificacionDetalleCargo.Activo = dataReader.GetBoolean(Activo);

            return viewAuditoriaListaVerificacionDetalleCargo;
        }
开发者ID:Avaruz,项目名称:SGC,代码行数:20,代码来源:ViewAuditoriaListaVerificacionDetalleCargoDb.cs


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