本文整理汇总了C#中IDataRecord类的典型用法代码示例。如果您正苦于以下问题:C# IDataRecord类的具体用法?C# IDataRecord怎么用?C# IDataRecord使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IDataRecord类属于命名空间,在下文中一共展示了IDataRecord类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ReadValues
/// <summary>
/// Reads the values from an <see cref="IDataRecord"/> and assigns the read values to this
/// object's properties. The database column's name is used to as the key, so the value
/// will not be found if any aliases are used or not all columns were selected.
/// </summary>
/// <param name="source">The object to add the extension method to.</param>
/// <param name="dataRecord">The <see cref="IDataRecord"/> to read the values from. Must already be ready to be read from.</param>
public static void ReadValues(this CharacterTemplateInventoryTable source, IDataRecord dataRecord)
{
Int32 i;
i = dataRecord.GetOrdinal("chance");
source.Chance = (ItemChance)dataRecord.GetUInt16(i);
i = dataRecord.GetOrdinal("character_template_id");
source.CharacterTemplateID = (CharacterTemplateID)dataRecord.GetUInt16(i);
i = dataRecord.GetOrdinal("id");
source.ID = dataRecord.GetInt32(i);
i = dataRecord.GetOrdinal("item_template_id");
source.ItemTemplateID = (ItemTemplateID)dataRecord.GetUInt16(i);
i = dataRecord.GetOrdinal("max");
source.Max = dataRecord.GetByte(i);
i = dataRecord.GetOrdinal("min");
source.Min = dataRecord.GetByte(i);
}
开发者ID:mateuscezar,项目名称:netgore,代码行数:35,代码来源:CharacterTemplateInventoryTableDbExtensions.cs
示例2: ChangeAuditEventLoaderInfo
public ChangeAuditEventLoaderInfo(IDataRecord record)
{
Contract.Requires(null != record, "The record object can not be null.");
record.TryGetOrdinal("TextData", out _textDataOrdinal);
record.TryGetOrdinal("DatabaseID", out _databaseIDOrdinal);
record.TryGetOrdinal("LineNumber", out _lineNumberOrdinal);
record.TryGetOrdinal("NTUserName", out _nTUserNameOrdinal);
record.TryGetOrdinal("NTDomainName", out _nTDomainNameOrdinal);
record.TryGetOrdinal("HostName", out _hostNameOrdinal);
record.TryGetOrdinal("ClientProcessID", out _clientProcessIDOrdinal);
record.TryGetOrdinal("ApplicationName", out _applicationNameOrdinal);
record.TryGetOrdinal("LoginName", out _loginNameOrdinal);
record.TryGetOrdinal("SPID", out _sPIDOrdinal);
record.TryGetOrdinal("StartTime", out _startTimeOrdinal);
record.TryGetOrdinal("EventSubClass", out _eventSubClassOrdinal);
record.TryGetOrdinal("Success", out _successOrdinal);
record.TryGetOrdinal("ServerName", out _serverNameOrdinal);
record.TryGetOrdinal("EventClass", out _eventClassOrdinal);
record.TryGetOrdinal("NestLevel", out _nestLevelOrdinal);
record.TryGetOrdinal("DatabaseName", out _databaseNameOrdinal);
record.TryGetOrdinal("OwnerName", out _ownerNameOrdinal);
record.TryGetOrdinal("DBUserName", out _dBUserNameOrdinal);
record.TryGetOrdinal("LoginSid", out _loginSidOrdinal);
record.TryGetOrdinal("ColumnPermissions", out _columnPermissionsOrdinal);
record.TryGetOrdinal("RequestID", out _requestIDOrdinal);
record.TryGetOrdinal("XactSequence", out _xactSequenceOrdinal);
record.TryGetOrdinal("EventSequence", out _eventSequenceOrdinal);
record.TryGetOrdinal("IsSystem", out _isSystemOrdinal);
record.TryGetOrdinal("SessionLoginName", out _sessionLoginNameOrdinal);
}
开发者ID:jshield,项目名称:sqlperms,代码行数:31,代码来源:ChangeAuditEventLoaderInfo.g.cs
示例3: MapRecord
/// <summary>
/// Map the basic fields for the BusinessContact table to the Channel model object
/// </summary>
/// <param name="record">The SqlDataReader with the executed query result</param>
/// <param name="prefix">a prefix used to identify fields for the BusinessContact model in the resultset if required</param>
/// <returns>An instance of BusinessContactl</returns>
internal static BusinessContactPerson MapRecord(IDataRecord record, string prefix = "")
{
return new BusinessContactPerson
{
BusinessId = DbHelper.ConvertValue<long>(record[prefix + Parameters.BusinessId]),
ContactTypeCode = DbHelper.ConvertValue<string>(record[prefix + Parameters.ContactTypeCode]),
TitleId = DbHelper.ConvertValue<byte?>(record[prefix + Parameters.TitleId]),
Forename = DbHelper.ConvertValue<string>(record[prefix + Parameters.Forename]),
Surname = DbHelper.ConvertValue<string>(record[prefix + Parameters.Surname]),
Email = DbHelper.ConvertValue<string>(record[prefix + Parameters.Email]),
UseBusinessAddress = DbHelper.ConvertValue<bool>(record[prefix + Parameters.UseBusinessAddress]),
AddressLine1 = DbHelper.ConvertValue<string>(record[prefix + Parameters.AddressLine1]),
AddressLine2 = DbHelper.ConvertValue<string>(record[prefix + Parameters.AddressLine2]),
AddressLine3 = DbHelper.ConvertValue<string>(record[prefix + Parameters.AddressLine3]),
City = DbHelper.ConvertValue<string>(record[prefix + Parameters.City]),
StateProvinceId = DbHelper.ConvertValue<int?>(record[prefix + Parameters.StateProvinceId]),
PostCode = DbHelper.ConvertValue<string>(record[prefix + Parameters.PostCode]),
CountryId = DbHelper.ConvertValue<int?>(record[prefix + Parameters.CountryId]),
Notes = DbHelper.ConvertValue<string>(record[prefix + Parameters.Notes]),
IsPrimary = DbHelper.ConvertValue<bool>(record[prefix + Parameters.IsPrimary]),
CreatedDatetime = DbHelper.ConvertValue<DateTime>(record[prefix + Parameters.CreatedDateTime]),
UpdatedByUserId = DbHelper.ConvertValue<Guid>(record[prefix + Parameters.UpdatedByUserId]),
UpdatedDateTime = DbHelper.ConvertValue<DateTime>(record[prefix + Parameters.UpdatedDatetime]),
};
}
开发者ID:ognjenm,项目名称:egle,代码行数:31,代码来源:BusinessContactMapper.cs
示例4: Fill_EntityProperty_Ids
public static void Fill_EntityProperty_Ids( IDataRecord record, IList _includeEntityPropertyList, ref Hashtable _entityProperty_ids ) {
if (_includeEntityPropertyList == null) return;
foreach (EntityPropertyInfo info in _includeEntityPropertyList) {
String columnName = info.ColumnName;
try
{
if (record[columnName] == DBNull.Value) continue;
if (_entityProperty_ids[columnName] == null)
{
_entityProperty_ids[columnName] = record[columnName] + ",";
}
else
{
String ids = _entityProperty_ids[columnName].ToString();
String tempId = "," + record[columnName] + ",";
if (("," + ids).IndexOf(tempId) < 0)
{
_entityProperty_ids[columnName] = ids + record[columnName] + ",";
}
}
}
catch (Exception ex)
{
LogManager.GetLogger("Class:System.ORM.Operation.EntityPropertyUtil Method:Fill_EntityProperty_Ids").Info("异常:" + ex.Message + "\n堆栈:" + ex.StackTrace);
}
}
}
开发者ID:mfz888,项目名称:xcore,代码行数:31,代码来源:EntityPropertyUtil.cs
示例5: C2C
/// <summary>
/// constructor
/// </summary>
/// <param name="dataRecord"></param>
public C2C(IDataRecord dataRecord)
{
this.Id = int.Parse(dataRecord["Id"].ToString());
this.Campus = dataRecord["CAMPUS"].ToString().Replace("'", string.Empty);
this.CadGap = dataRecord["CAD_GAP"].ToString();
this.CadMath = dataRecord["CAD_MATH"].ToString();
this.CadPost = dataRecord["CAD_POST"].ToString();
this.CadProgress = dataRecord["CAD_PROGRESS"].ToString();
this.CadRead = dataRecord["CAD_READ"].ToString();
this.CadScie = dataRecord["CAD_SCIE"].ToString();
this.CadSoci = dataRecord["CAD_SOCI"].ToString();
this.CampusName = dataRecord["CAMPNAME"].ToString();
this.Cflalted = dataRecord["CFLALTED"].ToString();
this.Cflchart = dataRecord["CFLCHART"].ToString();
this.CountyName = dataRecord["CNTYNAME"].ToString();
this.County = dataRecord["COUNTY"].ToString();
this.CRating = dataRecord["C_RATING"].ToString();
this.DistrictName = dataRecord["DISTNAME"].ToString();
this.District = dataRecord["DISTRICT"].ToString();
this.Grdspan = dataRecord["GRDSPAN"].ToString();
this.Grdtype = dataRecord["GRDTYPE"].ToString();
this.Paircamp = dataRecord["PAIRCAMP"].ToString();
this.Pairname = dataRecord["PAIRNAME"].ToString();
this.Region = dataRecord["REGION"].ToString();
}
开发者ID:commitdata,项目名称:dashboard_original,代码行数:29,代码来源:C2C.cs
示例6: Map
public object Map(IDataRecord record, Type type)
{
var instance = _instanceFactory.CreateInstance(type);
foreach (var propertySetter in _recordToPropertyMappers)
propertySetter.Execute(record, instance);
return instance;
}
开发者ID:JonasSamuelsson,项目名称:TinyORM,代码行数:7,代码来源:ObjectMapper.cs
示例7: ReadValues
/// <summary>
/// Reads the values from an <see cref="IDataRecord"/> and assigns the read values to this
/// object's properties. The database column's name is used to as the key, so the value
/// will not be found if any aliases are used or not all columns were selected.
/// </summary>
/// <param name="source">The object to add the extension method to.</param>
/// <param name="dataRecord">The <see cref="IDataRecord"/> to read the values from. Must already be ready to be read from.</param>
public static void ReadValues(this WorldStatsUserLevelTable source, IDataRecord dataRecord)
{
Int32 i;
i = dataRecord.GetOrdinal("character_id");
source.CharacterID = (CharacterID)dataRecord.GetInt32(i);
i = dataRecord.GetOrdinal("id");
source.ID = dataRecord.GetUInt32(i);
i = dataRecord.GetOrdinal("level");
source.Level = dataRecord.GetByte(i);
i = dataRecord.GetOrdinal("map_id");
source.MapID = (Nullable<MapID>)(dataRecord.IsDBNull(i) ? (ushort?)null : dataRecord.GetUInt16(i));
i = dataRecord.GetOrdinal("when");
source.When = dataRecord.GetDateTime(i);
i = dataRecord.GetOrdinal("x");
source.X = dataRecord.GetUInt16(i);
i = dataRecord.GetOrdinal("y");
source.Y = dataRecord.GetUInt16(i);
}
开发者ID:Vizzini,项目名称:netgore,代码行数:39,代码来源:WorldStatsUserLevelTableDbExtensions.cs
示例8: ReadValues
/// <summary>
/// Reads the values from an <see cref="IDataRecord"/> and assigns the read values to this
/// object's properties. The database column's name is used to as the key, so the value
/// will not be found if any aliases are used or not all columns were selected.
/// </summary>
/// <param name="source">The object to add the extension method to.</param>
/// <param name="dataRecord">The <see cref="IDataRecord"/> to read the values from. Must already be ready to be read from.</param>
public static void ReadValues(this AccountBanTable source, IDataRecord dataRecord)
{
Int32 i;
i = dataRecord.GetOrdinal("account_id");
source.AccountID = (AccountID)dataRecord.GetInt32(i);
i = dataRecord.GetOrdinal("end_time");
source.EndTime = dataRecord.GetDateTime(i);
i = dataRecord.GetOrdinal("expired");
source.Expired = dataRecord.GetBoolean(i);
i = dataRecord.GetOrdinal("id");
source.ID = dataRecord.GetInt32(i);
i = dataRecord.GetOrdinal("issued_by");
source.IssuedBy = (dataRecord.IsDBNull(i) ? null : dataRecord.GetString(i));
i = dataRecord.GetOrdinal("reason");
source.Reason = dataRecord.GetString(i);
i = dataRecord.GetOrdinal("start_time");
source.StartTime = dataRecord.GetDateTime(i);
}
开发者ID:Vizzini,项目名称:netgore,代码行数:39,代码来源:AccountBanTableDbExtensions.cs
示例9: Card
internal Card(IDataRecord reader)
{
Id = reader.GetInt32(0);
Ot = reader.GetInt32(1);
Alias = reader.GetInt32(2);
Setcode = reader.GetInt64(3);
Type = reader.GetInt32(4);
int levelInfo = reader.GetInt32(5);
Level = levelInfo & 0xff;
LScale = (levelInfo >> 24) & 0xff;
RScale = (levelInfo >> 16) & 0xff;
Race = reader.GetInt32(6);
Attribute = reader.GetInt32(7);
Attack = reader.GetInt32(8);
Defense = reader.GetInt32(9);
Data = new CardData()
{
Code = Id,
Alias = Alias,
Setcode = Setcode,
Type = Type,
Level = Level,
Attribute = Attribute,
Race = Race,
Attack = Attack,
Defense = Defense,
LScale = LScale,
RScale = RScale
};
}
开发者ID:mycard,项目名称:ygosharp,代码行数:33,代码来源:Card.cs
示例10: ReadCharArray
/// <summary>
/// Reads a char array from the current <see cref="IDataRecord"/>.
/// </summary>
/// <param name="dataRecord">The target <see cref="IDataRecord"/>.</param>
/// <param name="ordinal">The ordinal for the field that contains the stream data.</param>
/// <returns>A new char array.</returns>
public static char[] ReadCharArray(IDataRecord dataRecord, int ordinal)
{
long length = dataRecord.GetChars(ordinal, 0, null, 0, int.MaxValue);
var buffer = new char[length];
dataRecord.GetChars(ordinal, 0, buffer, 0, (int)length);
return buffer;
}
开发者ID:seesharper,项目名称:DbExtensions,代码行数:13,代码来源:StreamHelper.cs
示例11: GetGuid
/// <summary>
/// Retrieve a Guid value from a data record with a default value.
/// </summary>
public override Guid GetGuid(IDataRecord dataRecord, int ordinal, Guid defaultValue)
{
if (dataRecord == null)
throw new ArgumentNullException("dataRecord");
if (dataRecord.IsDBNull(ordinal))
return defaultValue;
try
{
return new Guid(base.GetString(dataRecord, ordinal));
}
catch (ArgumentNullException)
{
return defaultValue;
}
catch (FormatException)
{
return defaultValue;
}
catch (OverflowException)
{
return defaultValue;
}
}
开发者ID:JuRogn,项目名称:OA,代码行数:28,代码来源:OracleValueReader.cs
示例12: ReadByteArray
/// <summary>
/// Reads a byte array from the current <see cref="IDataRecord"/>.
/// </summary>
/// <param name="dataRecord">The target <see cref="IDataRecord"/>.</param>
/// <param name="ordinal">The ordinal for the field that contains the stream data.</param>
/// <returns>A new byte array.</returns>
public static byte[] ReadByteArray(IDataRecord dataRecord, int ordinal)
{
long length = dataRecord.GetBytes(ordinal, 0, null, 0, int.MaxValue);
var buffer = new byte[length];
dataRecord.GetBytes(ordinal, 0, buffer, 0, (int)length);
return buffer;
}
开发者ID:seesharper,项目名称:DbExtensions,代码行数:13,代码来源:StreamHelper.cs
示例13: LogoutEventLoaderInfo
public LogoutEventLoaderInfo(IDataRecord record)
{
Contract.Requires(null != record, "The record object can not be null.");
record.TryGetOrdinal("TextData", out _textDataOrdinal);
record.TryGetOrdinal("DatabaseID", out _databaseIDOrdinal);
record.TryGetOrdinal("NTUserName", out _nTUserNameOrdinal);
record.TryGetOrdinal("NTDomainName", out _nTDomainNameOrdinal);
record.TryGetOrdinal("HostName", out _hostNameOrdinal);
record.TryGetOrdinal("ClientProcessID", out _clientProcessIDOrdinal);
record.TryGetOrdinal("ApplicationName", out _applicationNameOrdinal);
record.TryGetOrdinal("LoginName", out _loginNameOrdinal);
record.TryGetOrdinal("SPID", out _sPIDOrdinal);
record.TryGetOrdinal("Duration", out _durationOrdinal);
record.TryGetOrdinal("StartTime", out _startTimeOrdinal);
record.TryGetOrdinal("EndTime", out _endTimeOrdinal);
record.TryGetOrdinal("Reads", out _readsOrdinal);
record.TryGetOrdinal("Writes", out _writesOrdinal);
record.TryGetOrdinal("CPU", out _cPUOrdinal);
record.TryGetOrdinal("EventSubClass", out _eventSubClassOrdinal);
record.TryGetOrdinal("Success", out _successOrdinal);
record.TryGetOrdinal("ServerName", out _serverNameOrdinal);
record.TryGetOrdinal("EventClass", out _eventClassOrdinal);
record.TryGetOrdinal("DatabaseName", out _databaseNameOrdinal);
record.TryGetOrdinal("LoginSid", out _loginSidOrdinal);
record.TryGetOrdinal("RequestID", out _requestIDOrdinal);
record.TryGetOrdinal("EventSequence", out _eventSequenceOrdinal);
record.TryGetOrdinal("Type", out _typeOrdinal);
record.TryGetOrdinal("IsSystem", out _isSystemOrdinal);
record.TryGetOrdinal("SessionLoginName", out _sessionLoginNameOrdinal);
record.TryGetOrdinal("GroupID", out _groupIDOrdinal);
}
开发者ID:jshield,项目名称:sqlperms,代码行数:32,代码来源:LogoutEventLoaderInfo.g.cs
示例14: DatabasePrincipalImpersonationEvent
internal DatabasePrincipalImpersonationEvent(IDataRecord record, DatabasePrincipalImpersonationEventLoaderInfo loaderInfo)
{
Contract.Requires(null != record, "The record must be valid.");
Contract.Requires(null != loaderInfo, "The loaderInfo must be valid.");
if (null != loaderInfo.TextDataOrdinal)
_textData = record.GetNullableString(loaderInfo.TextDataOrdinal.Value);
if (null != loaderInfo.DatabaseIDOrdinal)
_databaseID = record.GetNullableInt32(loaderInfo.DatabaseIDOrdinal.Value);
if (null != loaderInfo.TransactionIDOrdinal)
_transactionID = record.GetNullableInt64(loaderInfo.TransactionIDOrdinal.Value);
if (null != loaderInfo.NTUserNameOrdinal)
_nTUserName = record.GetNullableString(loaderInfo.NTUserNameOrdinal.Value);
if (null != loaderInfo.NTDomainNameOrdinal)
_nTDomainName = record.GetNullableString(loaderInfo.NTDomainNameOrdinal.Value);
if (null != loaderInfo.HostNameOrdinal)
_hostName = record.GetNullableString(loaderInfo.HostNameOrdinal.Value);
if (null != loaderInfo.ApplicationNameOrdinal)
_applicationName = record.GetNullableString(loaderInfo.ApplicationNameOrdinal.Value);
if (null != loaderInfo.LoginNameOrdinal)
_loginName = record.GetNullableString(loaderInfo.LoginNameOrdinal.Value);
if (null != loaderInfo.SPIDOrdinal)
_sPID = record.GetNullableInt32(loaderInfo.SPIDOrdinal.Value);
if (null != loaderInfo.StartTimeOrdinal)
_startTime = record.GetNullableDateTime(loaderInfo.StartTimeOrdinal.Value);
if (null != loaderInfo.PermissionsOrdinal)
_permissions = record.GetNullableInt64(loaderInfo.PermissionsOrdinal.Value);
if (null != loaderInfo.EventSubClassOrdinal)
_eventSubClass = record.GetNullableInt32(loaderInfo.EventSubClassOrdinal.Value);
if (null != loaderInfo.SuccessOrdinal)
_success = record.GetNullableInt32(loaderInfo.SuccessOrdinal.Value);
if (null != loaderInfo.ServerNameOrdinal)
_serverName = record.GetNullableString(loaderInfo.ServerNameOrdinal.Value);
if (null != loaderInfo.ObjectTypeOrdinal)
_objectType = record.GetNullableInt32(loaderInfo.ObjectTypeOrdinal.Value);
if (null != loaderInfo.NestLevelOrdinal)
_nestLevel = record.GetNullableInt32(loaderInfo.NestLevelOrdinal.Value);
if (null != loaderInfo.ObjectNameOrdinal)
_objectName = record.GetNullableString(loaderInfo.ObjectNameOrdinal.Value);
if (null != loaderInfo.DatabaseNameOrdinal)
_databaseName = record.GetNullableString(loaderInfo.DatabaseNameOrdinal.Value);
if (null != loaderInfo.OwnerNameOrdinal)
_ownerName = record.GetNullableString(loaderInfo.OwnerNameOrdinal.Value);
if (null != loaderInfo.RoleNameOrdinal)
_roleName = record.GetNullableString(loaderInfo.RoleNameOrdinal.Value);
if (null != loaderInfo.DBUserNameOrdinal)
_dBUserName = record.GetNullableString(loaderInfo.DBUserNameOrdinal.Value);
if (null != loaderInfo.LoginSidOrdinal)
_loginSid = (Byte[])record.GetValue(loaderInfo.LoginSidOrdinal.Value);
if (null != loaderInfo.RequestIDOrdinal)
_requestID = record.GetNullableInt32(loaderInfo.RequestIDOrdinal.Value);
if (null != loaderInfo.XactSequenceOrdinal)
_xactSequence = record.GetNullableInt64(loaderInfo.XactSequenceOrdinal.Value);
if (null != loaderInfo.EventSequenceOrdinal)
_eventSequence = record.GetNullableInt64(loaderInfo.EventSequenceOrdinal.Value);
if (null != loaderInfo.IsSystemOrdinal)
_isSystem = record.GetNullableInt32(loaderInfo.IsSystemOrdinal.Value);
if (null != loaderInfo.SessionLoginNameOrdinal)
_sessionLoginName = record.GetNullableString(loaderInfo.SessionLoginNameOrdinal.Value);
}
开发者ID:jshield,项目名称:sqlperms,代码行数:60,代码来源:DatabasePrincipalImpersonationEvent.g.cs
示例15: ReadFinancialTransactionTagSetTypeFromDataReader
private static BasicFinancialTransactionTagSetType ReadFinancialTransactionTagSetTypeFromDataReader(IDataRecord reader)
{
int financialTransactionTagSetTypeId = reader.GetInt32(0);
string resourceName = reader.GetString(1);
return new BasicFinancialTransactionTagSetType(financialTransactionTagSetTypeId, resourceName);
}
开发者ID:SwarmCorp,项目名称:Swarmops,代码行数:7,代码来源:Database-FinancialTransactionTagSetTypes.cs
示例16: DataRecordMemberNode
public DataRecordMemberNode(ObjectNode parent, Type[] types, IDataRecord r, int maxDepth, DataContextDriver dcDriver) : base(parent, r, maxDepth, dcDriver)
{
if (base.IsAtNestingLimit())
{
base.GraphTruncated = true;
}
else
{
for (int i = 0; i < r.FieldCount; i++)
{
object item = r.GetValue(i);
Type type = null;
if (types != null)
{
type = types[i];
}
else if (item != null)
{
type = item.GetType();
}
if (!(item is IDataRecord))
{
}
base.Members.Add(new MemberData(r.GetName(i), type, ObjectNode.Create(this, item, maxDepth, base.DCDriver)));
}
if ((base.Members.Count > 50) && (base.NestingDepth > 1))
{
base.InitiallyHidden = true;
}
}
}
开发者ID:CuneytKukrer,项目名称:TestProject,代码行数:31,代码来源:DataRecordMemberNode.cs
示例17: LoadElement
public void LoadElement(IDataRecord record)
{
DescriptorUid = (Guid)record["DescriptorUid"];
DescriptorTypeUid = (Guid)record["DescriptorTypeUid"];
NodeUid = (Guid)record["NodeUid"];
RelationshipUid = (Guid)record["RelationshipUid"];
}
开发者ID:chris-tomich,项目名称:Glyma,代码行数:7,代码来源:Descriptor.cs
示例18: DatabaseMirroringLoginEventLoaderInfo
public DatabaseMirroringLoginEventLoaderInfo(IDataRecord record)
{
Contract.Requires(null != record, "The record object can not be null.");
record.TryGetOrdinal("TextData", out _textDataOrdinal);
record.TryGetOrdinal("DatabaseID", out _databaseIDOrdinal);
record.TryGetOrdinal("TransactionID", out _transactionIDOrdinal);
record.TryGetOrdinal("NTUserName", out _nTUserNameOrdinal);
record.TryGetOrdinal("NTDomainName", out _nTDomainNameOrdinal);
record.TryGetOrdinal("HostName", out _hostNameOrdinal);
record.TryGetOrdinal("ClientProcessID", out _clientProcessIDOrdinal);
record.TryGetOrdinal("ApplicationName", out _applicationNameOrdinal);
record.TryGetOrdinal("LoginName", out _loginNameOrdinal);
record.TryGetOrdinal("SPID", out _sPIDOrdinal);
record.TryGetOrdinal("StartTime", out _startTimeOrdinal);
record.TryGetOrdinal("EventSubClass", out _eventSubClassOrdinal);
record.TryGetOrdinal("ServerName", out _serverNameOrdinal);
record.TryGetOrdinal("EventClass", out _eventClassOrdinal);
record.TryGetOrdinal("State", out _stateOrdinal);
record.TryGetOrdinal("ObjectName", out _objectNameOrdinal);
record.TryGetOrdinal("FileName", out _fileNameOrdinal);
record.TryGetOrdinal("OwnerName", out _ownerNameOrdinal);
record.TryGetOrdinal("RoleName", out _roleNameOrdinal);
record.TryGetOrdinal("TargetUserName", out _targetUserNameOrdinal);
record.TryGetOrdinal("LoginSid", out _loginSidOrdinal);
record.TryGetOrdinal("ProviderName", out _providerNameOrdinal);
record.TryGetOrdinal("EventSequence", out _eventSequenceOrdinal);
record.TryGetOrdinal("IsSystem", out _isSystemOrdinal);
record.TryGetOrdinal("SessionLoginName", out _sessionLoginNameOrdinal);
}
开发者ID:jshield,项目名称:sqlperms,代码行数:30,代码来源:DatabaseMirroringLoginEventLoaderInfo.g.cs
示例19: Populate
public static Object Populate( IDataRecord rd, ObjectInfo state )
{
IEntity obj = Entity.New( state.EntityInfo.Type.FullName );
// state
//obj.state.Order = state.Order;
for (int i = 0; i < rd.FieldCount; i++) {
Object fdvalue = rd[i];
if (fdvalue == null || fdvalue == DBNull.Value) continue;
EntityPropertyInfo ep = state.EntityInfo.GetPropertyByColumn( rd.GetName( i ) );
if (ep == null) continue;
try {
if (ep.IsEntity || ep.IsAbstractEntity) {
setEntityPropertyValueById( obj, state, ep, rd.GetInt32( i ) );
}
else {
ep.SetValue( obj, getReaderValue( fdvalue, ep.Type ) );
}
}
catch (Exception ex) {
logger.Error( ex.Message + "=" + ep.Name + "_" + ep.Type );
logger.Error( ex.StackTrace );
throw ex;
}
}
return obj;
}
开发者ID:robin88,项目名称:wojilu,代码行数:34,代码来源:FillUtil.cs
示例20: ReadOutboundMailFromDataReader
private static BasicOutboundMail ReadOutboundMailFromDataReader (IDataRecord reader)
{
int outboundMailId = reader.GetInt32(0);
int authorType = reader.GetInt32(1);
int authorPersonId = reader.GetInt32(2);
string title = reader.GetString(3);
string body = reader.GetString(4);
int mailPriority = reader.GetInt32(5);
int mailTypeId = reader.GetInt32(6);
int organizationId = reader.GetInt32(7);
int geographyId = reader.GetInt32(8);
DateTime createdDateTime = reader.GetDateTime(9);
DateTime releaseDateTime = reader.GetDateTime(10);
bool readyForPickup = reader.GetBoolean(11);
bool resolved = reader.GetBoolean(12);
bool processed = reader.GetBoolean(13);
DateTime resolvedDateTime = reader.GetDateTime(14);
DateTime startProcessDateTime = reader.GetDateTime(15);
DateTime endProcessDateTime = reader.GetDateTime(16);
int recipientCount = reader.GetInt32(17);
int recipientsSuccess = reader.GetInt32(18);
int recipientsFail = reader.GetInt32(19);
return new BasicOutboundMail(outboundMailId, (MailAuthorType)authorType, authorPersonId, title, body,
mailPriority, mailTypeId, organizationId, geographyId, createdDateTime,
releaseDateTime, readyForPickup, resolved, processed, resolvedDateTime, startProcessDateTime, endProcessDateTime,
recipientCount, recipientsSuccess, recipientsFail);
}
开发者ID:SwarmCorp,项目名称:Swarmops,代码行数:31,代码来源:Database-OutboundMails.cs
注:本文中的IDataRecord类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论