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


C# SqlDataReader.GetByte方法代码示例

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


在下文中一共展示了SqlDataReader.GetByte方法的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: DataToModel

        /// <summary>
        /// 数据转用户实体
        /// </summary>
        public static UserInfo DataToModel(SqlDataReader rdr)
        {
            UserInfo user = new UserInfo();
            if (!rdr.IsDBNull(0)) user.UserID = rdr.GetInt32(0);
            if (!rdr.IsDBNull(1)) user.UserName = rdr.GetString(1);
            if (!rdr.IsDBNull(2)) user.UserPassword = rdr.GetString(2);
            if (!rdr.IsDBNull(3)) user.UserNickName = rdr.GetString(3);
            if (!rdr.IsDBNull(4)) user.UserImage = rdr.GetString(4);
            if (!rdr.IsDBNull(5)) user.UserPhone = rdr.GetString(5);
            if (!rdr.IsDBNull(6)) user.UserEmail = rdr.GetString(6);
            if (!rdr.IsDBNull(7)) user.UserTheme = rdr.GetString(7);
            if (!rdr.IsDBNull(8)) user.UserLevel = rdr.GetByte(8);
            if (!rdr.IsDBNull(9)) user.UserFrom = rdr.GetString(9);
            if (!rdr.IsDBNull(10)) user.ModifyDate = rdr.GetDateTime(10);
            if (!rdr.IsDBNull(11)) user.CreateDate = rdr.GetDateTime(11);
            if (!rdr.IsDBNull(12)) user.UserCity = rdr.GetString(12);
            if (!rdr.IsDBNull(13)) user.UserMoney = rdr.GetDecimal(13);
            if (!rdr.IsDBNull(14)) user.UserWorkDay = rdr.GetString(14);
            if (!rdr.IsDBNull(15)) user.UserFunction = rdr.GetString(15);
            if (!rdr.IsDBNull(16)) user.CategoryRate = rdr.GetInt32(16);
            if (!rdr.IsDBNull(17)) user.Synchronize = rdr.GetByte(17);
            if (!rdr.IsDBNull(18)) user.MoneyStart = rdr.GetDecimal(18);
            if (!rdr.IsDBNull(19)) user.IsUpdate = rdr.GetByte(19);

            return user;
        }
开发者ID:pyfxl,项目名称:fxlweb,代码行数:29,代码来源:UserTableDAL.cs

示例3: DataToModel

        /// <summary>
        /// 数据转专题实体
        /// </summary>
        public static ZhuanTiInfo DataToModel(SqlDataReader rdr)
        {
            ZhuanTiInfo zhuanTi = new ZhuanTiInfo();
            if (!rdr.IsDBNull(0)) zhuanTi.ZhuanTiID = rdr.GetInt32(0);
            if (!rdr.IsDBNull(1)) zhuanTi.ZhuanTiName = rdr.GetString(1);
            if (!rdr.IsDBNull(2)) zhuanTi.ZhuanTiImage = rdr.GetString(2);
            if (!rdr.IsDBNull(3)) zhuanTi.UserID = rdr.GetInt32(3);
            if (!rdr.IsDBNull(4)) zhuanTi.ZhuanTiLive = rdr.GetByte(4);
            if (!rdr.IsDBNull(5)) zhuanTi.Synchronize = rdr.GetByte(5);
            if (!rdr.IsDBNull(6)) zhuanTi.ModifyDate = rdr.GetDateTime(6);
            if (!rdr.IsDBNull(7)) zhuanTi.ZTID = rdr.GetInt32(7);

            return zhuanTi;
        }
开发者ID:pyfxl,项目名称:fxlweb,代码行数:17,代码来源:ZhuanTiTableDAL.cs

示例4: Map

 public override void Map(SqlDataReader sqlDataReader)
 {
     this.Id = sqlDataReader.GetGuid(sqlDataReader.GetOrdinal("Id"));
     this.Name = sqlDataReader.GetString(sqlDataReader.GetOrdinal("Name"));
     this.Level = sqlDataReader.GetByte(sqlDataReader.GetOrdinal("Level"));
     this.CountryId = sqlDataReader.GetGuid(sqlDataReader.GetOrdinal("CountryId"));
 }
开发者ID:mchound,项目名称:falyze,代码行数:7,代码来源:League.cs

示例5: DataToModel

        /// <summary>
        /// 数据转转账实体
        /// </summary>
        public static ZhuanZhangInfo DataToModel(SqlDataReader rdr)
        {
            ZhuanZhangInfo zhang = new ZhuanZhangInfo();
            if (!rdr.IsDBNull(0)) zhang.ZhuanZhangID = rdr.GetInt32(0);
            if (!rdr.IsDBNull(1)) zhang.ZhuanZhangFrom = rdr.GetInt32(1);
            if (!rdr.IsDBNull(2)) zhang.ZhuanZhangTo = rdr.GetInt32(2);
            if (!rdr.IsDBNull(3)) zhang.ZhuanZhangDate = rdr.GetDateTime(3);
            if (!rdr.IsDBNull(4)) zhang.ZhuanZhangMoney = rdr.GetDecimal(4);
            if (!rdr.IsDBNull(5)) zhang.ZhuanZhangLive = rdr.GetByte(5);
            if (!rdr.IsDBNull(7)) zhang.Synchronize = rdr.GetByte(6);
            if (!rdr.IsDBNull(6)) zhang.ModifyDate = rdr.GetDateTime(7);
            if (!rdr.IsDBNull(7)) zhang.UserID = rdr.GetInt32(8);
            if (!rdr.IsDBNull(7)) zhang.ZhuanZhangNote = rdr.GetString(9);
            if (!rdr.IsDBNull(7)) zhang.ZZID = rdr.GetInt32(10);

            return zhang;
        }
开发者ID:pyfxl,项目名称:fxlweb,代码行数:20,代码来源:ZhuanZhangTableDAL.cs

示例6: DataToModel

        /// <summary>
        /// 数据转钱包实体
        /// </summary>
        public static CardInfo DataToModel(SqlDataReader rdr)
        {
            CardInfo card = new CardInfo();
            if (!rdr.IsDBNull(0)) card.CardID = rdr.GetInt32(0);
            if (!rdr.IsDBNull(1)) card.CardName = rdr.GetString(1);
            if (!rdr.IsDBNull(2)) card.CardNumber = rdr.GetString(2);
            if (!rdr.IsDBNull(3)) card.CardImage = rdr.GetString(3);
            if (!rdr.IsDBNull(4)) card.CardMoney = rdr.GetDecimal(4);
            if (!rdr.IsDBNull(5)) card.CardLive = rdr.GetByte(5);
            if (!rdr.IsDBNull(6)) card.Synchronize = rdr.GetByte(6);
            if (!rdr.IsDBNull(7)) card.ModifyDate = rdr.GetDateTime(7);
            if (!rdr.IsDBNull(8)) card.CDID = rdr.GetInt32(8);
            if (!rdr.IsDBNull(9)) card.UserID = rdr.GetInt32(9);
            if (!rdr.IsDBNull(10)) card.MoneyStart = rdr.GetDecimal(10);
            if (!rdr.IsDBNull(11)) card.CardShow = rdr.GetByte(11);

            return card;
        }
开发者ID:pyfxl,项目名称:fxlweb,代码行数:21,代码来源:CardTableDAL.cs

示例7: DataToModel

        /// <summary>
        /// 数据转查询实体
        /// </summary>
        public static UserQueryInfo DataToModel(SqlDataReader rdr)
        {
            UserQueryInfo query = new UserQueryInfo();
            if (!rdr.IsDBNull(0)) query.UserQueryID = rdr.GetInt32(0);
            if (!rdr.IsDBNull(1)) query.UserQueryName = rdr.GetString(1);
            if (!rdr.IsDBNull(2)) query.UserQueryURL = rdr.GetString(2);
            if (!rdr.IsDBNull(3)) query.UserQueryValue = rdr.GetString(3);
            if (!rdr.IsDBNull(4)) query.UserQueryLive = rdr.GetByte(4);
            if (!rdr.IsDBNull(5)) query.UserID = rdr.GetInt32(5);
            if (!rdr.IsDBNull(6)) query.ModifyDate = rdr.GetDateTime(6);

            return query;
        }
开发者ID:pyfxl,项目名称:fxlweb,代码行数:16,代码来源:UserQueryTableDAL.cs

示例8: DataToModel

        /// <summary>
        /// 数据转第三方登录实体
        /// </summary>
        public static OAuthInfo DataToModel(SqlDataReader rdr)
        {
            OAuthInfo oauth = new OAuthInfo();
            if (!rdr.IsDBNull(0)) oauth.OAuthID = rdr.GetInt32(0);
            if (!rdr.IsDBNull(1)) oauth.OpenID = rdr.GetString(1);
            if (!rdr.IsDBNull(2)) oauth.AccessToken = rdr.GetString(2);
            if (!rdr.IsDBNull(3)) oauth.UserID = rdr.GetInt32(3);
            if (!rdr.IsDBNull(4)) oauth.OldUserID = rdr.GetInt32(4);
            if (!rdr.IsDBNull(5)) oauth.OAuthBound = rdr.GetByte(5);
            if (!rdr.IsDBNull(6)) oauth.OAuthFrom = rdr.GetString(6);
            if (!rdr.IsDBNull(7)) oauth.ModifyDate = rdr.GetDateTime(7);

            return oauth;
        }
开发者ID:pyfxl,项目名称:fxlweb,代码行数:17,代码来源:OAuthTableDAL.cs

示例9: build_sql_job_metric_from_reader

        SqlJobMetrics build_sql_job_metric_from_reader(SqlDataReader reader)
        {
            var metric = new SqlJobMetrics();

            metric.job_name = reader.GetString(0);
            metric.message = reader.GetString(1);

            var job_outcome_key = reader.GetByte(2);
            metric.job_status = get_job_outcome_from_key(job_outcome_key);

            metric.last_run = reader.GetDateTime(3);
            metric.job_step = reader.GetInt16(4);

            return metric;
        }
开发者ID:daxko,项目名称:dashboard,代码行数:15,代码来源:SqlJobMetricRepository.cs

示例10: getFieldValue

 public static short getFieldValue(SqlDataReader dr, int ind, short def)
 {
     short val = def;
     if (!dr.IsDBNull(ind))
     {
         System.TypeCode tp = System.Type.GetTypeCode(dr.GetFieldType(ind));
         System.TypeCode typeCode = tp;
         switch (typeCode)
         {
             case System.TypeCode.Boolean:
                 val = (dr.GetBoolean(ind) ? System.Convert.ToInt16(1) : System.Convert.ToInt16(0));
                 break;
             case System.TypeCode.Char:
             case System.TypeCode.SByte:
             case System.TypeCode.UInt16:
                 break;
             case System.TypeCode.Byte:
                 val = System.Convert.ToInt16(dr.GetByte(ind));
                 break;
             case System.TypeCode.Int16:
                 val = dr.GetInt16(ind);
                 break;
             case System.TypeCode.Int32:
                 val = System.Convert.ToInt16(dr.GetInt32(ind));
                 break;
             default:
                 if (typeCode == System.TypeCode.Decimal)
                 {
                     val = System.Convert.ToInt16(dr.GetDecimal(ind));
                 }
                 break;
         }
     }
     return val;
 }
开发者ID:ranyaof,项目名称:gismaster,代码行数:35,代码来源:DBManagerSQL.cs

示例11: ReadKeyData

 private void ReadKeyData(SqlDataReader reader, Dictionary<Guid, IDictionary<XName, InstanceValue>> associatedInstanceKeys, Dictionary<Guid, IDictionary<XName, InstanceValue>> completedInstanceKeys)
 {
     if ((StoreUtilities.GetNextResultSet(base.InstancePersistenceCommand.Name, reader) == null) && !reader.IsDBNull(1))
     {
         do
         {
             Guid guid = reader.GetGuid(1);
             bool boolean = reader.GetBoolean(2);
             InstanceEncodingOption @byte = (InstanceEncodingOption) reader.GetByte(3);
             Dictionary<Guid, IDictionary<XName, InstanceValue>> dictionary = boolean ? associatedInstanceKeys : completedInstanceKeys;
             if (!reader.IsDBNull(4))
             {
                 dictionary[guid] = SerializationUtilities.DeserializeKeyMetadata((byte[]) reader.GetValue(4), @byte);
             }
             else
             {
                 dictionary[guid] = new Dictionary<XName, InstanceValue>();
             }
         }
         while (reader.Read());
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:22,代码来源:LoadWorkflowAsyncResult.cs

示例12: ReadInstanceMetadataChanges

 private void ReadInstanceMetadataChanges(SqlDataReader reader, Dictionary<XName, InstanceValue> instanceMetadata)
 {
     if ((StoreUtilities.GetNextResultSet(base.InstancePersistenceCommand.Name, reader) != null) || !reader.IsDBNull(1))
     {
         do
         {
             InstanceEncodingOption @byte = (InstanceEncodingOption) reader.GetByte(1);
             byte[] serializedMetadataProperties = (byte[]) reader.GetValue(2);
             foreach (KeyValuePair<XName, InstanceValue> pair in SerializationUtilities.DeserializeMetadataPropertyBag(serializedMetadataProperties, @byte))
             {
                 XName key = pair.Key;
                 InstanceValue value2 = pair.Value;
                 if (value2.Value is DeletedMetadataValue)
                 {
                     instanceMetadata.Remove(key);
                 }
                 else
                 {
                     instanceMetadata[key] = value2;
                 }
             }
         }
         while (reader.Read());
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:25,代码来源:LoadWorkflowAsyncResult.cs

示例13: ProcessSqlResult

 protected override Exception ProcessSqlResult(SqlDataReader reader)
 {
     Exception nextResultSet = StoreUtilities.GetNextResultSet(base.InstancePersistenceCommand.Name, reader);
     if (nextResultSet == null)
     {
         Guid instanceId = reader.GetGuid(1);
         reader.GetInt64(2);
         byte[] primitiveDataProperties = reader.IsDBNull(3) ? null : ((byte[]) reader.GetValue(3));
         byte[] complexDataProperties = reader.IsDBNull(4) ? null : ((byte[]) reader.GetValue(4));
         byte[] serializedMetadataProperties = reader.IsDBNull(5) ? null : ((byte[]) reader.GetValue(5));
         InstanceEncodingOption @byte = (InstanceEncodingOption) reader.GetByte(6);
         InstanceEncodingOption instanceEncodingOption = (InstanceEncodingOption) reader.GetByte(7);
         long instanceVersion = reader.GetInt64(8);
         bool boolean = reader.GetBoolean(9);
         bool flag2 = reader.GetBoolean(10);
         InstancePersistenceCommand instancePersistenceCommand = base.InstancePersistenceCommand;
         LoadWorkflowByInstanceKeyCommand command = base.InstancePersistenceCommand as LoadWorkflowByInstanceKeyCommand;
         if (!base.InstancePersistenceContext.InstanceView.IsBoundToInstance)
         {
             base.InstancePersistenceContext.BindInstance(instanceId);
         }
         if (!base.InstancePersistenceContext.InstanceView.IsBoundToInstanceOwner)
         {
             base.InstancePersistenceContext.BindInstanceOwner(base.StoreLock.LockOwnerId, base.StoreLock.LockOwnerId);
         }
         if (!base.InstancePersistenceContext.InstanceView.IsBoundToLock)
         {
             ((InstanceLockTracking) base.InstancePersistenceContext.UserContext).TrackStoreLock(instanceId, instanceVersion, base.DependentTransaction);
             base.InstancePersistenceContext.BindAcquiredLock(instanceVersion);
         }
         this.instanceData = SerializationUtilities.DeserializePropertyBag(primitiveDataProperties, complexDataProperties, @byte);
         this.instanceMetadata = SerializationUtilities.DeserializeMetadataPropertyBag(serializedMetadataProperties, instanceEncodingOption);
         if (!flag2)
         {
             this.ReadInstanceMetadataChanges(reader, this.instanceMetadata);
             this.ReadKeyData(reader, this.associatedInstanceKeys, this.completedInstanceKeys);
         }
         else if (command != null)
         {
             foreach (KeyValuePair<Guid, IDictionary<XName, InstanceValue>> pair in command.InstanceKeysToAssociate)
             {
                 this.associatedInstanceKeys.Add(pair.Key, pair.Value);
             }
             if (!this.associatedInstanceKeys.ContainsKey(command.LookupInstanceKey))
             {
                 base.InstancePersistenceContext.AssociatedInstanceKey(command.LookupInstanceKey);
                 this.associatedInstanceKeys.Add(command.LookupInstanceKey, new Dictionary<XName, InstanceValue>());
             }
         }
         if (command != null)
         {
             foreach (KeyValuePair<Guid, IDictionary<XName, InstanceValue>> pair2 in command.InstanceKeysToAssociate)
             {
                 base.InstancePersistenceContext.AssociatedInstanceKey(pair2.Key);
                 if (pair2.Value != null)
                 {
                     foreach (KeyValuePair<XName, InstanceValue> pair3 in pair2.Value)
                     {
                         base.InstancePersistenceContext.WroteInstanceKeyMetadataValue(pair2.Key, pair3.Key, pair3.Value);
                     }
                 }
             }
         }
         base.InstancePersistenceContext.LoadedInstance(boolean ? InstanceState.Initialized : InstanceState.Uninitialized, this.instanceData, this.instanceMetadata, this.associatedInstanceKeys, this.completedInstanceKeys);
         return nextResultSet;
     }
     if (nextResultSet is InstanceLockLostException)
     {
         base.InstancePersistenceContext.InstanceHandle.Free();
     }
     return nextResultSet;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:72,代码来源:LoadWorkflowAsyncResult.cs

示例14: MakeTipoAlerta

        /// <summary>
        /// Creates a new instance of the TipoAlerta class and populates it with data from the specified SqlDataReader.
        /// </summary>
        private static TipoAlertaInfo MakeTipoAlerta(SqlDataReader dataReader)
        {
            TipoAlertaInfo tipoAlerta = new TipoAlertaInfo();

            if (dataReader.IsDBNull(TipoAlertaId) == false)
                tipoAlerta.TipoAlertaId = dataReader.GetInt32(TipoAlertaId);
            if (dataReader.IsDBNull(Descripcion) == false)
                tipoAlerta.Descripcion = dataReader.GetString(Descripcion);
            if (dataReader.IsDBNull(ColorRojo) == false)
                tipoAlerta.ColorRojo = dataReader.GetByte(ColorRojo);
            if (dataReader.IsDBNull(ColorVerde) == false)
                tipoAlerta.ColorVerde = dataReader.GetByte(ColorVerde);
            if (dataReader.IsDBNull(ColorAzul) == false)
                tipoAlerta.ColorAzul = dataReader.GetByte(ColorAzul);
            if (dataReader.IsDBNull(ColorAlfa) == false)
                tipoAlerta.ColorAlfa = dataReader.GetByte(ColorAlfa);

            return tipoAlerta;
        }
开发者ID:Avaruz,项目名称:SGC,代码行数:22,代码来源:TipoAlertaDb.cs

示例15: GetColumns

        private List<Column> GetColumns(SqlDataReader reader)
        {
            var list = new List<Column>();

            while (reader.Read())
            {
                var column = new Column();
                column.Name = reader.GetString(0);
                column.Type = reader.GetString(1);
                column.Length = reader.GetInt16(2);
                column.IsNullable = reader.GetInt32(3) == 0;
                if (reader.FieldCount >= 5)
                {
                    column.Scale = reader.GetByte(4);
                    column.Precision = reader.GetByte(5);
                    column.IsPrimaryKey = reader.GetInt32(6) == 1;
                    column.Default = reader.GetString(7);

                    if (column.Default.StartsWith("(("))
                        column.Default = column.Default.Substring(1, column.Default.Length - 2);
                }

                list.Add(column);
            }

            return list;
        }
开发者ID:AlanCS,项目名称:Database-Utilities,代码行数:27,代码来源:SqlServerDatabase2.cs


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