本文整理汇总了C#中System.Data.OleDb.OleDbDataReader.SafeGetInt16方法的典型用法代码示例。如果您正苦于以下问题:C# OleDbDataReader.SafeGetInt16方法的具体用法?C# OleDbDataReader.SafeGetInt16怎么用?C# OleDbDataReader.SafeGetInt16使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Data.OleDb.OleDbDataReader
的用法示例。
在下文中一共展示了OleDbDataReader.SafeGetInt16方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CopyMemberToBO
public static MemberInfo CopyMemberToBO(OleDbDataReader rdr)
{
MemberInfo member = null;
try
{
member = new MemberInfo();
member.Id = rdr.GetInt32(0);
member.Status = rdr.GetInt16(1);
member.Username = rdr.GetString(2);
member.NTUsername = rdr.SafeGetString(3);
member.Email = rdr.SafeGetString(4);
member.Country = rdr.SafeGetString(5);
member.HomePage = rdr.SafeGetString(6);
member.Signature = rdr.SafeGetString(7);
member.MemberLevel = rdr.GetInt16(8);
member.AIM = rdr.SafeGetString(9);
member.Yahoo = rdr.SafeGetString(10);
member.ICQ = rdr.SafeGetString(11);
member.Skype = rdr.SafeGetString(12);
member.PostCount = rdr.SafeGetInt32(13) ?? 0;
member.MemberSince = rdr.GetSnitzDate(14) == null ? DateTime.UtcNow : rdr.GetSnitzDate(14).Value;
member.LastVisitDate = rdr.GetSnitzDate(15);
member.LastPostDate = rdr.GetSnitzDate(16);
member.Title = rdr.SafeGetString(17); //member.MemberTitle(rdr.SafeGetString(17));
member.AllowSubscriptions = rdr.SafeGetInt16(18) == 1;
member.HideEmail = rdr.SafeGetInt16(19) == 1;
member.ReceiveEmails = rdr.SafeGetInt16(20) == 1;
member.MembersIP = rdr.SafeGetString(21);
member.ViewSignatures = rdr.SafeGetInt16(22) == 1;
member.UseSignature = rdr.SafeGetInt16(23) == 1;
member.Voted = rdr.SafeGetInt32(24) == 1;
member.AllowEmail = rdr.SafeGetInt16(25) == 1;
member.Avatar = rdr.SafeGetString(26);
member.Theme = rdr.SafeGetString(27);
member.TimeOffset = rdr.SafeGetDouble(28);
member.DateOfBirth = rdr.SafeGetString(29);
member.Age = rdr.SafeGetString(30);
member.Password = rdr.GetString(31);
member.ValidationKey = rdr.SafeGetString(32);
member.IsValid = rdr.SafeGetInt32(33) == 1;
member.LastUpdateDate = rdr.GetSnitzDate(34);
member.MaritalStatus = rdr.SafeGetString(35);
member.Firstname = rdr.SafeGetString(36);
member.Lastname = rdr.SafeGetString(37);
member.Occupation = rdr.SafeGetString(38);
member.Gender = rdr.SafeGetString(39);
member.Hobbies = rdr.SafeGetString(40);
member.LatestNews = rdr.SafeGetString(41);
member.FavouriteQuote = rdr.SafeGetString(42);
member.Biography = rdr.SafeGetString(43);
member.FavLink1 = rdr.SafeGetString(44);
member.FavLink2 = rdr.SafeGetString(45);
member.City = rdr.SafeGetString(46);
member.State = rdr.SafeGetString(47);
member.UseDaylightSaving = rdr.SafeGetInt16(48) == 1;
member.TimeZone = rdr.SafeGetString(49);
}
catch (Exception ex)
{
throw new Exception("Error copying reader to BO");
OleDbDataReader rdrtest = rdr;
string test = ex.Message;
}
string title = member.Title;
//member.Rank = new RankInfo(member.Username, ref title, member.PostCount);
member.Title = title;
return member;
}
示例2: CopyPrivateMessageToBO
public static PrivateMessageInfo CopyPrivateMessageToBO(OleDbDataReader rdr)
{
PrivateMessageInfo pm = new PrivateMessageInfo
{
Id = rdr.GetInt32(0),
Subject = rdr.SafeGetString(1),
FromMemberId = rdr.GetInt32(2),
ToMemberId = rdr.GetInt32(3),
SentDate = rdr.SafeGetString(4),
Message = rdr.SafeGetString(5),
Count = rdr.SafeGetString(6),
Read = rdr.GetInt32(7),
//Mail = Convert.ToInt32(rdr.SafeGetString(8)),
OutBox = rdr.SafeGetInt16(9),
ToMemberName = rdr.SafeGetString(10),
FromMemberName = rdr.SafeGetString(11)
};
pm.Sent = pm.SentDate.ToDateTime();
return pm;
}