本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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"));
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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());
}
}
示例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());
}
}
示例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;
}
示例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;
}
示例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;
}