本文整理汇总了C#中System.Data.SqlClient.SqlDataReader.StringField方法的典型用法代码示例。如果您正苦于以下问题:C# SqlDataReader.StringField方法的具体用法?C# SqlDataReader.StringField怎么用?C# SqlDataReader.StringField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Data.SqlClient.SqlDataReader
的用法示例。
在下文中一共展示了SqlDataReader.StringField方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MapGangwayEventStatusAsync
/// <summary>
/// Maps the gangway event status asynchronous.
/// </summary>
/// <param name="dataReader">The data reader.</param>
/// <returns>Gangway Event Status</returns>
internal static async Task<string> MapGangwayEventStatusAsync(SqlDataReader dataReader)
{
var value = default(string);
if (dataReader != null && dataReader.HasRows)
{
await dataReader.ReadAsync();
value = dataReader.StringField(StatusField);
}
return value;
}
示例2: MapConfigurationData
/// <summary>
/// Maps the configuration data.
/// </summary>
/// <param name="dataReader">The data reader.</param>
/// <returns>The component setting collection</returns>
internal static async Task<ComponentSettingCollection> MapConfigurationData(SqlDataReader dataReader)
{
var componentSettingCollection = new ComponentSettingCollection();
if (dataReader != null)
{
while (await dataReader.ReadAsync())
{
var ComponentSettings = new ComponentSetting
{
Id = dataReader.GuidField(Id).ToString(),
Name = dataReader.StringField(Name),
Value = dataReader.StringField(Value)
};
componentSettingCollection.Add(ComponentSettings);
}
}
return componentSettingCollection;
}
示例3: MapMediaItemAddress
/// <summary>
/// Maps the specified data reader.
/// </summary>
/// <param name="dataReader">The data reader.</param>
/// <returns>Media Item Address</returns>
internal static async Task<string> MapMediaItemAddress(SqlDataReader dataReader)
{
var mediaItemAddress = string.Empty;
if (dataReader != null)
{
while (await dataReader.ReadAsync())
{
var mediaItemId = dataReader.Int32Field(MediaItemId).ToString();
var baseAddress = dataReader.StringField(Mediapath);
mediaItemAddress = string.Concat(mediaItemId, CommonConstants.Comma, baseAddress);
}
if (!dataReader.IsClosed)
{
dataReader.Close();
}
}
return await Task.FromResult(mediaItemAddress);
}
示例4: RetrieveGuestPersonalDetail
/// <summary>
/// Retrieves the guest personal detail.
/// </summary>
/// <param name="dataReader">The data reader.</param>
/// <returns>Guest Collection.</returns>
private static async Task<GuestCollection> RetrieveGuestPersonalDetail(SqlDataReader dataReader)
{
var guestCollection = new GuestCollection();
if (dataReader != null)
{
while (await dataReader.ReadAsync())
{
var guest = new Guest();
guest.GuestId = dataReader.Int32Field(GuestId).ToString();
guest.PersonalDetail = new PersonalDetail();
guest.PersonalDetail.Title = dataReader.StringField(Title);
guest.PersonalDetail.FirstName = dataReader.StringField(FirstName);
guest.PersonalDetail.MiddleName = dataReader.StringField(MiddleName);
guest.PersonalDetail.LastName = dataReader.StringField(LastName);
guest.PersonalDetail.Nickname = dataReader.StringField(NickName);
guest.PersonalDetail.PreferredName = dataReader.StringField(PreferredName);
guest.PersonalDetail.Suffix = dataReader.StringField(Suffix);
guest.PersonalDetail.Birthdate = dataReader.DateTimeNullableField(BirthDate);
guest.PersonalDetail.BirthCountryId = dataReader.Int32NullableField(BirthCountryId).HasValue ? dataReader.Int32NullableField("BirthCountryID").Value.ToString() : null;
guest.PersonalDetail.CitizenshipCountryId = dataReader.Int32NullableField(CitizenshipCountryId).HasValue ? dataReader.Int32NullableField("BirthCountryID").Value.ToString() : null;
guest.PersonalDetail.Gender = dataReader.StringField(Gender);
guest.PersonalDetail.MaritalStatus = dataReader.StringField(MaritalStatus);
guest.PersonalDetail.Occupation = dataReader.StringField(Occupation);
guest.PersonalDetail.AnniversaryDate = dataReader.DateTimeNullableField(AnniversaryDate);
guest.PersonalDetail.DocumentNumber = dataReader.StringField(DocumentNumber);
guest.PersonalDetail.Age = dataReader.Int16Field(Age);
guest.PersonalDetail.SourceId = dataReader.StringField(SourceId);
guestCollection.Add(guest);
}
}
return guestCollection;
}
示例5: MapUserDetails
/// <summary>
///
/// </summary>
/// <param name="dataReader"></param>
/// <returns></returns>
public static async Task<Crewmember> MapUserDetails(SqlDataReader dataReader)
{
var crew = new Crewmember();
if (dataReader != null)
{
while (await dataReader.ReadAsync())
{
crew.CrewmemberId = dataReader.Int32Field(CrewMemberId).ToString();
crew.PersonalDetail = new PersonalDetail();
crew.PersonalDetail.Title = dataReader.StringField(Title);
crew.PersonalDetail.FirstName = dataReader.StringField(FirstName);
crew.PersonalDetail.MiddleName = dataReader.StringField(MiddleName);
crew.PersonalDetail.LastName = dataReader.StringField(LastName);
crew.PersonalDetail.Nickname = dataReader.StringField(NickName);
crew.PersonalDetail.PreferredName = dataReader.StringField(PreferredName);
crew.PersonalDetail.Suffix = dataReader.StringField(Suffix);
crew.PersonalDetail.Gender = dataReader.StringField(Gender);
crew.PersonalDetail.Age = dataReader.Int32Field(Age);
crew.SecurityPhotoAddress = dataReader.StringField(SecurityPhotoAddress);
byte[] bytes = await crew.SecurityPhotoAddress.ImageAddressToByteArray();
crew.Photo = bytes.ToBitmapSource();
crew.AssignPhotoByteArray(new Collection<byte>(bytes));
}
}
return crew;
}
示例6: MapLoyaltyLevelTypes
/// <summary>
/// Maps the loyalty level types.
/// </summary>
/// <param name="dataReader">The data reader.</param>
/// <returns>Loyalty level types</returns>
private static async Task<LoyaltyLevelTypeCollection> MapLoyaltyLevelTypes(SqlDataReader dataReader)
{
var loyaltyLevelTypeCollection = new LoyaltyLevelTypeCollection();
if (dataReader != null)
{
while (await dataReader.ReadAsync())
{
var loyaltyLevelType = new LoyaltyLevelType
{
LoyaltyLevelTypeId = dataReader.Int32Field(LoyaltyLevelTypeId).ToString(),
NoOfCruiseNights = dataReader.Int32Field(NoOfCruiseNights),
Name = dataReader.StringField(Name),
LogoImageAddress = dataReader.StringField(LogoImageAddress),
BrandId = dataReader.Int16Field(BrandId).ToString()
};
byte[] bytes = await loyaltyLevelType.LogoImageAddress.ImageAddressToByteArray();
loyaltyLevelType.LoyaltyIcon = bytes.ToBitmapSource();
loyaltyLevelTypeCollection.Add(loyaltyLevelType);
}
}
return loyaltyLevelTypeCollection;
}
示例7: MapPersonMessage
/// <summary>
/// Maps the person message.
/// </summary>
/// <param name="dataReader">The data reader.</param>
/// <returns>filled person message.</returns>
private static PersonMessage MapPersonMessage(SqlDataReader dataReader)
{
return new PersonMessage
{
AlertId = dataReader.Int32Field(AlertId).ToString(CultureInfo.CurrentCulture),
StatusId = dataReader.ByteField(StatusID).ToString(CultureInfo.CurrentCulture),
AddedBy = dataReader.StringField(AddedBy),
IsSoundEnable = dataReader.BooleanField(IsSoundEnable),
AddedDateTime = dataReader.DateTimeNullableField(AddedDateTime)
};
}
示例8: MapPorts
/// <summary>
/// Maps the ports.
/// </summary>
/// <param name="dataReader">The data reader.</param>
/// <returns>port collection.</returns>
private static async Task<PortCollection> MapPorts(SqlDataReader dataReader)
{
var portCollection = new PortCollection();
if (dataReader != null)
{
while (await dataReader.ReadAsync())
{
var port = new Port
{
PortId = dataReader.Int32Field(PortId).ToString(),
CountryId = dataReader.Int32Field(CountryId).ToString(),
Code = dataReader.StringField(Code),
City = dataReader.StringField(City),
State = dataReader.StringField(State),
StateId = dataReader.Int32NullableField(StateId).ToString(),
Description = dataReader.StringField(Description),
Name = dataReader.StringField(Name)
};
portCollection.Add(port);
}
}
return portCollection;
}
示例9: RetrieveVisitorPersonalDetail
/// <summary>
/// Maps the visitor personal detail.
/// </summary>
/// <param name="dataReader">The data reader.</param>
/// <returns>Visitor collection</returns>
private static async Task<VisitorCollection> RetrieveVisitorPersonalDetail(SqlDataReader dataReader)
{
var visitors = new VisitorCollection();
if (dataReader != null)
{
while (await dataReader.ReadAsync())
{
var visitor = new Visitor();
visitor.VisitorId = dataReader.Int32Field(VisitorId).ToString();
visitor.PersonalDetail = new PersonalDetail();
visitor.VisitorInfo = new VisitorInfo();
visitor.PersonalDetail.Age = dataReader.Int16NullableField(Age);
visitor.PersonalDetail.AnniversaryDate = dataReader.DateTimeNullableField(AnniversaryDate);
visitor.PersonalDetail.BirthCountryId = dataReader.Int32NullableField(BirthCountryId).ToString();
visitor.PersonalDetail.Birthdate = dataReader.DateTimeNullableField(BirthDate);
visitor.PersonalDetail.CitizenshipCountryId = dataReader.Int32NullableField(CitizenshipCountryId).ToString();
visitor.PersonalDetail.FirstName = dataReader.StringField(FirstName);
visitor.PersonalDetail.Gender = dataReader.StringField(Gender);
visitor.PersonalDetail.LastName = dataReader.StringField(LastName);
visitor.PersonalDetail.MaritalStatus = dataReader.StringField(MaritalStatus);
visitor.PersonalDetail.MiddleName = dataReader.StringField(MiddleName);
visitor.PersonalDetail.Nickname = dataReader.StringField(NickName);
visitor.PersonalDetail.Occupation = dataReader.StringField(Occupation);
visitor.PersonalDetail.DocumentNumber = dataReader.StringField(DocumentNumber);
visitor.PersonalDetail.Suffix = dataReader.StringField(Suffix);
visitor.PersonalDetail.Title = dataReader.StringField(Title);
visitor.PersonalDetail.DepartmentName = dataReader.StringField(Department);
visitor.PersonalDetail.DepartmentPOC = dataReader.StringField(Contact);
visitor.VisitorInfo.CompanyName = dataReader.StringField(Company);
visitor.PersonalDetail.DocumentNumber = dataReader.StringField(DocumentNumber);
visitor.PersonalDetail.DocumentType = dataReader.StringField(DocumentType);
////visitor.VisitorInfo.ContactNumber = dataReader.StringField(ContactPhoneNumber);
visitor.VisitorInfo.CompanyContactNumber = dataReader.StringField(ContactPhoneNumber);
visitor.PersonalDetail.DocumentTypeId = dataReader.Int16Field(DocumentTypeId).ToString();
visitors.Add(visitor);
}
}
return visitors;
}
示例10: MapCrew
/// <summary>
/// Maps the crew.
/// </summary>
/// <param name="dataReader">The data reader.</param>
/// <returns>Crew member collection</returns>
private static async Task<CrewmemberCollection> MapCrew(SqlDataReader dataReader)
{
var crewmemberCollection = new CrewmemberCollection();
if (dataReader != null)
{
while (await dataReader.ReadAsync())
{
var crew = new Crewmember();
crew.CrewmemberId = dataReader.Int32Field(CrewMemberId).ToString();
crew.CrewmemberTypeId = dataReader.ByteField(CrewMemberTypeId).ToString();
crew.EmployeeNo = dataReader.StringField(EmployeeNo);
var hasAlert = dataReader.BooleanNullableField(HasAlert);
var hasMessage = dataReader.BooleanNullableField(HasMessage);
crew.HasAlert = hasAlert.HasValue ? hasAlert.Value : false;
crew.HasMessage = hasMessage.HasValue ? hasMessage.Value : false;
crew.Position = dataReader.StringField(Position);
crew.LastDateTime = dataReader.DateTimeNullableField(LastDateTime);
crew.LastEvent = dataReader.StringField(LastEvent);
crew.SafetyNumber = dataReader.StringField(SafetyNumber);
crew.SecurityPhotoAddress = dataReader.StringField(SecurityPhotoAddress);
crew.Stateroom = dataReader.StringField(Stateroom);
crew.StateroomOccupancy = dataReader.ByteField(StateroomOccupancy).ToString();
crew.Department = dataReader.StringField(Department);
crew.PortAssignedDate = dataReader.DateTimeNullableField(PortAssignedDate);
byte[] bytes = await crew.SecurityPhotoAddress.ImageAddressToByteArray();
crew.Photo = bytes.ToBitmapSource();
crew.AssignPhotoByteArray(new Collection<byte>(bytes));
crewmemberCollection.Add(crew);
}
}
return crewmemberCollection;
}
示例11: MapVoyages
/// <summary>
/// Maps the voyages.
/// </summary>
/// <param name="dataReader">The data reader.</param>
/// <returns>The Collection of voyages</returns>
private static async Task<ICollection<Voyage>> MapVoyages(SqlDataReader dataReader)
{
var voyages = new Collection<Voyage>();
IDictionary<string, ICollection<Itinerary>> itineraries = new Dictionary<string, ICollection<Itinerary>>();
if (dataReader != null)
{
while (await dataReader.ReadAsync())
{
var voyage = new Voyage
{
VoyageId = dataReader.Int32Field(VoyageId).ToString(),
ShipId = dataReader.ByteField(ShipId).ToString(),
Number = dataReader.StringField(Number),
Name = dataReader.StringField(Name),
EmbarkDate = dataReader.DateTimeField(EmbarkDate),
DebarkDate = dataReader.DateTimeField(DebarkDate),
EmbarkPortId = dataReader.Int32Field(EmbarkPortId).ToString(),
DebarkPortId = dataReader.Int32Field(DebarkPortId).ToString(),
Nights = dataReader.ByteField(Nights),
DestinationId = dataReader.StringField(DestinationName),
IsActive = dataReader.BooleanField(IsActive),
MediaItemAddress = dataReader.StringField(MediaItemAddress)
};
byte[] bytes = await voyage.MediaItemAddress.ImageAddressToByteArray();
voyage.ItineraryGraphImage = bytes.ToBitmapSource();
voyages.Add(voyage);
}
}
return voyages;
}
示例12: MapGangwayLocations
/// <summary>
/// Maps the gangway locations.
/// </summary>
/// <param name="dataReader">The data reader.</param>
/// <returns>The collection of gangway location</returns>
private static async Task<ICollection<GangwayLocation>> MapGangwayLocations(SqlDataReader dataReader)
{
var gangwayLocations = new Collection<GangwayLocation>();
if (dataReader != null)
{
while (await dataReader.ReadAsync())
{
var gangwayLocation = new GangwayLocation
{
LocationId = dataReader.Int32Field(LocationId).ToString(),
LocationTypeId = dataReader.ByteField(LocationTypeId).ToString(),
Name = dataReader.StringField(Name)
};
gangwayLocations.Add(gangwayLocation);
}
}
return gangwayLocations.OrderBy(a => a.Name).ToList();
}
示例13: MapStateroomCategories
/// <summary>
/// Maps the stateroom categories.
/// </summary>
/// <param name="dataReader">The data reader.</param>
/// <returns>The collection of stateroom category</returns>
private static async Task<StateroomCategoryCollection> MapStateroomCategories(SqlDataReader dataReader)
{
var stateroomCategories = new StateroomCategoryCollection();
if (dataReader != null)
{
while (await dataReader.ReadAsync())
{
var stateroomCategory = new StateroomCategory
{
StateroomCategoryTypeId = dataReader.Int16Field(StateroomCategoryTypeId).ToString(),
StateroomCategoryType = dataReader.StringField(StateroomCategoryType),
MediaItemAddress = dataReader.StringField(MediaItemAddress),
Category = dataReader.StringField(Category)
};
byte[] bytes = await stateroomCategory.MediaItemAddress.ImageAddressToByteArray();
stateroomCategory.StateroomIcon = bytes.ToBitmapSource();
stateroomCategories.Add(stateroomCategory);
}
}
return stateroomCategories;
}
示例14: MapShips
/// <summary>
/// Maps the ships.
/// </summary>
/// <param name="dataReader">The data reader.</param>
/// <returns>Ship data filled.</returns>
private static async Task<Ship> MapShips(SqlDataReader dataReader)
{
var ship = new Ship();
if (dataReader != null)
{
ship.BrandId = dataReader.ByteField(BrandId).ToString();
ship.Code = dataReader.StringField(Code);
ship.MediaItemAddress = dataReader.StringField(MediaItemAddress);
ship.Name = dataReader.StringField(Name);
ship.ShipId = dataReader.Int16Field(ShipId).ToString();
byte[] bytes = await ship.MediaItemAddress.ImageAddressToByteArray();
ship.ShipImage = bytes.ToBitmapSource();
}
return await Task.FromResult(ship);
}
示例15: MapDocumentTypes
/// <summary>
/// Maps the document types.
/// </summary>
/// <param name="dataReader">The data reader.</param>
/// <returns>Document types</returns>
private static async Task<DocumentTypeCollection> MapDocumentTypes(SqlDataReader dataReader)
{
var documentTypeCollection = new DocumentTypeCollection();
if (dataReader != null)
{
while (await dataReader.ReadAsync())
{
var documentType = new DocumentType
{
DocumentTypeId = dataReader.Int16Field(DocumentTypeId).ToString(),
Code = dataReader.StringField(Code),
Name = dataReader.StringField(Name),
CountryId = dataReader.Int32NullableField(CountryId).HasValue ? dataReader.Int32NullableField(CountryId).Value.ToString() : null
};
documentTypeCollection.Add(documentType);
}
}
return documentTypeCollection;
}