本文整理汇总了C#中Mono.Data.Sqlite.SqliteDataReader.GetBoolean方法的典型用法代码示例。如果您正苦于以下问题:C# SqliteDataReader.GetBoolean方法的具体用法?C# SqliteDataReader.GetBoolean怎么用?C# SqliteDataReader.GetBoolean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mono.Data.Sqlite.SqliteDataReader
的用法示例。
在下文中一共展示了SqliteDataReader.GetBoolean方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetUserFromReader
/// <summary>
/// A helper function that takes the current row from the SqliteDataReader
/// and hydrates a MembershipUser from the values. Called by the
/// MembershipUser.GetUser implementation.
/// </summary>
/// <param name="reader">SqliteDataReader object</param>
/// <returns>MembershipUser object</returns>
MembershipUser GetUserFromReader(SqliteDataReader reader)
{
object providerUserKey = reader.GetValue(0);
string username = reader.GetString(1);
string email = string.Empty;
if (!reader.IsDBNull(2))
email = reader.GetString(2);
string passwordQuestion = string.Empty;
if (!reader.IsDBNull(3))
passwordQuestion = reader.GetString(3);
string comment = string.Empty;
if (!reader.IsDBNull(4))
comment = reader.GetString(4);
bool isApproved = reader.GetBoolean(5);
bool isLockedOut = reader.GetBoolean(6);
DateTime creationDate = reader.GetDateTime(7);
DateTime lastLoginDate = new DateTime();
if (!reader.IsDBNull(8))
lastLoginDate = reader.GetDateTime(8);
DateTime lastActivityDate = reader.GetDateTime(9);
DateTime lastPasswordChangedDate = reader.GetDateTime(10);
DateTime lastLockedOutDate = new DateTime();
if (!reader.IsDBNull(11))
lastLockedOutDate = reader.GetDateTime(11);
MembershipUser u = new MembershipUser(this.Name,
username,
providerUserKey,
email,
passwordQuestion,
comment,
isApproved,
isLockedOut,
creationDate,
lastLoginDate,
lastActivityDate,
lastPasswordChangedDate,
lastLockedOutDate);
return u;
}
示例2: LoadCrlRecord
X509CrlRecord LoadCrlRecord(SqliteDataReader reader, X509CrlParser parser, ref byte[] buffer)
{
var record = new X509CrlRecord ();
for (int i = 0; i < reader.FieldCount; i++) {
switch (reader.GetName (i)) {
case "CRL":
record.Crl = DecodeX509Crl (reader, parser, i, ref buffer);
break;
case "THISUPDATE":
record.ThisUpdate = reader.GetDateTime (i);
break;
case "NEXTUPDATE":
record.NextUpdate = reader.GetDateTime (i);
break;
case "DELTA":
record.IsDelta = reader.GetBoolean (i);
break;
case "ID":
record.Id = reader.GetInt32 (i);
break;
}
}
return record;
}
示例3: GetUserFromReader
//
// GetUserFromReader
// A helper function that takes the current row from the SQLiteDataReader
// and hydrates a MembershipUser from the values. Called by the
// MembershipUser.GetUser implementation.
//
private MembershipUser GetUserFromReader(SqliteDataReader reader)
{
if (reader.GetString(1)=="") return null;
object providerUserKey=null;
string strGooid=Guid.NewGuid().ToString();
if (reader.GetValue(0).ToString().Length > 0)
providerUserKey = new Guid(reader.GetValue(0).ToString());
else
providerUserKey = new Guid(strGooid);
string username = reader.GetString(1);
string email = reader.GetString(2);
string passwordQuestion = "";
if (reader.GetValue(3) != DBNull.Value)
passwordQuestion = reader.GetString(3);
string comment = "";
if (reader.GetValue(4) != DBNull.Value)
comment = reader.GetString(4);
bool tmpApproved = (reader.GetValue(5) == null);
bool isApproved=false;
if(tmpApproved)
isApproved = reader.GetBoolean(5);
bool tmpLockedOut = (reader.GetValue(6) == null);
bool isLockedOut = false;
if(tmpLockedOut)
isLockedOut = reader.GetBoolean(6);
DateTime creationDate = DateTime.Now;
try
{
if (reader.GetValue(6) != DBNull.Value)
creationDate = reader.GetDateTime(7);
}
catch { }
DateTime lastLoginDate = DateTime.Now;
try
{
if (reader.GetValue(8) != DBNull.Value)
lastLoginDate = reader.GetDateTime(8);
}
catch { }
DateTime lastActivityDate = DateTime.Now;
try
{
if (reader.GetValue(9) != DBNull.Value)
lastActivityDate = reader.GetDateTime(9);
}
catch { }
DateTime lastPasswordChangedDate = DateTime.Now;
try
{
if (reader.GetValue(10) != DBNull.Value)
lastPasswordChangedDate = reader.GetDateTime(10);
}
catch { }
DateTime lastLockedOutDate = DateTime.Now;
try
{
if (reader.GetValue(11) != DBNull.Value)
lastLockedOutDate = reader.GetDateTime(11);
}
catch { }
MembershipUser u = new MembershipUser(this.Name,
username,
providerUserKey,
email,
passwordQuestion,
comment,
isApproved,
isLockedOut,
creationDate,
lastLoginDate,
lastActivityDate,
lastPasswordChangedDate,
lastLockedOutDate);
return u;
}
示例4: LoadCertificateRecord
X509CertificateRecord LoadCertificateRecord(SqliteDataReader reader, X509CertificateParser parser, ref byte[] buffer)
{
var record = new X509CertificateRecord ();
for (int i = 0; i < reader.FieldCount; i++) {
switch (reader.GetName (i)) {
case "CERTIFICATE":
record.Certificate = DecodeCertificate (reader, parser, i, ref buffer);
break;
case "PRIVATEKEY":
record.PrivateKey = DecodePrivateKey (reader, i, ref buffer);
break;
case "ALGORITHMS":
record.Algorithms = DecodeEncryptionAlgorithms (reader, i);
break;
case "ALGORITHMSUPDATED":
record.AlgorithmsUpdated = reader.GetDateTime (i);
break;
case "TRUSTED":
record.IsTrusted = reader.GetBoolean (i);
break;
case "ID":
record.Id = reader.GetInt32 (i);
break;
}
}
return record;
}