本文整理汇总了C#中MySql.Data.MySqlClient.MySqlDataReader.GetBoolean方法的典型用法代码示例。如果您正苦于以下问题:C# MySqlDataReader.GetBoolean方法的具体用法?C# MySqlDataReader.GetBoolean怎么用?C# MySqlDataReader.GetBoolean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MySql.Data.MySqlClient.MySqlDataReader
的用法示例。
在下文中一共展示了MySqlDataReader.GetBoolean方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetInschrijvingFromDataReader
protected Inschrijving GetInschrijvingFromDataReader(MySqlDataReader dataReader)
{
bool eetMee = dataReader.GetBoolean("eetMee");
bool betaald = dataReader.GetBoolean("betaald");
Inschrijving inschrijving = new Inschrijving { EetMee = eetMee, Betaald = betaald };
return inschrijving;
}
示例2: DBColumnToPyObject
public static PyObject DBColumnToPyObject(int index, ref MySqlDataReader reader)
{
Type type = reader.GetFieldType(index);
switch (type.Name)
{
case "String":
return new PyString(reader.GetString(index));
case "UInt32":
case "Int32":
case "UInt16":
case "Int16":
case "SByte":
case "Byte":
return new PyInt(reader.GetInt32(index));
case "UInt64":
case "Int64":
return new PyLongLong(reader.GetInt64(index));
case "Byte[]":
return new PyBuffer((byte[])reader.GetValue(index));
case "Double":
return new PyFloat(reader.GetDouble(index));
case "Decimal":
return new PyFloat((double)reader.GetDecimal(index));
case "Boolean":
return new PyBool(reader.GetBoolean(index));
default:
Log.Error("Database", "Unhandled MySQL type " + type.Name);
break;
}
return null;
}
示例3: GetGenreFromDataReader
protected Genre GetGenreFromDataReader(MySqlDataReader dataReader)
{
string genreNaam = dataReader.GetString("genrenaam");
int genreId = dataReader.GetInt32("genre_id");
bool verslavend = dataReader.GetBoolean("verslavend");
Genre genre = new Genre { ID = genreId, Naam = genreNaam, Verslavend = verslavend };
return genre;
}
示例4: Guild
public Guild(MySqlDataReader reader, MySqlConnection con)
{
ID = reader.GetInt32("ID");
Name = reader.GetString("GuildName");
// _Password = (byte[])reader.GetValue("Password");
_Password = new byte[12];
AllowGuildWar = reader.GetBoolean("AllowGuildWar");
Message = reader.GetString("GuildMessage");
MessageCreateTime = reader.GetDateTime(8);
MessageCreaterID = reader.GetInt32("CreaterID");
CreateTime = DateTime.Now;//read later
GuildMoney = reader.GetInt64("GuildMoney");
Members = new List<GuildMember>();
ThreadLocker = new object();
GuildStore = new GuildStorage(this);
Load();
}
示例5: ReadClientData
private Client ReadClientData(MySqlDataReader reader)
{
Client client = new Client();
client.client_id = reader.GetInt32("client_id");
client.client_name = reader.GetString("client_name");
client.client_surname = reader.GetString("client_surname");
client.client_email = reader.GetString("client_email");
client.client_phone = !reader.IsDBNull(4) ? reader.GetString("client_phone") : null;
client.client_birth_date = reader.GetDateTime("client_birth_date");
client.client_member_from = reader.GetDateTime("client_member_from");
client.client_member_to = !reader.IsDBNull(7) ? reader.GetDateTime("client_member_to") : DateTime.MinValue;
client.client_street = !reader.IsDBNull(8) ? reader.GetString("client_street") : null;
client.client_city = !reader.IsDBNull(9) ? reader.GetString("client_city") : null;
client.client_zip = !reader.IsDBNull(10) ? reader.GetString("client_zip") : null;
client.client_country = !reader.IsDBNull(11) ? reader.GetString("country") : null;
client.client_isEmp = reader.GetBoolean("client_isEmp");
client.client_is_active = reader.GetBoolean("client_is_active");
client.client_login = reader.GetString("client_login");
client.client_pass_hash = reader.GetString("client_pass_hash");
client.client_last_act = !reader.IsDBNull(16) ? reader.GetDateTime("client_last_act") : DateTime.MinValue;
return client;
}
示例6: LoadFromReader
public void LoadFromReader(MySqlDataReader _reader)
{
m_id = _reader["id"].GetType() != typeof(System.DBNull) ? _reader.GetInt64("id") : 0;
mc_id = false;
m_title = _reader["title"].GetType() != typeof(System.DBNull) ? _reader.GetString("title") : "";
mc_title = false;
m_parent_id = _reader["parent_id"].GetType() != typeof(System.DBNull) ? _reader.GetInt64("parent_id") : 0;
mc_parent_id = false;
m_category_id = _reader["category_id"].GetType() != typeof(System.DBNull) ? _reader.GetInt64("category_id") : 0;
mc_category_id = false;
m_nested_category_id = _reader["nested_category_id"].GetType() != typeof(System.DBNull) ? _reader.GetInt64("nested_category_id") : 0;
mc_nested_category_id = false;
m_item_order = _reader["item_order"].GetType() != typeof(System.DBNull) ? _reader.GetInt64("item_order") : 0;
mc_item_order = false;
m_in_search = _reader["in_search"].GetType() != typeof(System.DBNull) ? _reader.GetBoolean("in_search") : false;
mc_in_search = false;
m_map_key = _reader["map_key"].GetType() != typeof(System.DBNull) ? _reader.GetString("map_key") : "";
mc_map_key = false;
}
示例7: LoadGameServerFromQuery
/// <summary>
/// Read server parameters from the standard database query column
/// layout and construct and return a NWGameServer corresponding to the
/// data in question.
/// </summary>
/// <param name="Reader">Supplies a reader containing the results of a
/// query that correspond to the standard column set.</param>
/// <returns>A NWGameServer object describing the current row.</returns>
private NWGameServer LoadGameServerFromQuery(MySqlDataReader Reader)
{
NWGameServer Server = new NWGameServer();
Server.ExpansionsMask = Reader.GetUInt32(1);
Server.BuildNumber = Reader.GetUInt32(2);
Server.ModuleName = Reader.GetString(3);
Server.ServerName = Reader.GetString(4);
Server.ActivePlayerCount = Reader.GetUInt32(5);
Server.MaximumPlayerCount = Reader.GetUInt32(6);
Server.LocalVault = Reader.GetBoolean(7);
Server.LastHeartbeat = Reader.GetDateTime(8);
Server.ServerAddress = Reader.GetString(9);
Server.Online = Reader.GetBoolean(10);
Server.PrivateServer = Reader.GetBoolean(11);
Server.ModuleDescription = Reader.GetString(12);
Server.ModuleUrl = Reader.GetString(13);
Server.GameType = Reader.GetUInt32(14);
Server.MinimumLevel = Reader.GetUInt32(15);
Server.MaximumLevel = Reader.GetUInt32(16);
Server.PVPLevel = Reader.GetUInt32(17);
Server.PlayerPause = Reader.GetBoolean(18);
Server.OnePartyOnly = Reader.GetBoolean(19);
Server.ELCEnforced = Reader.GetBoolean(20);
Server.ILREnforced = Reader.GetBoolean(21);
Server.PWCUrl = Reader.GetString(22);
Server.ServerDescription = Reader.GetString(23);
return Server;
}
示例8: getBool
public static bool? getBool(MySqlDataReader dr, string column)
{
int ordinal = dr.GetOrdinal(column);
if (dr.IsDBNull(ordinal))
{
return null;
}
else
{
return dr.GetBoolean(ordinal);
}
}
示例9: GetUserFromReader
private static MembershipUser GetUserFromReader(MySqlDataReader reader)
{
int id_user = reader.GetInt32("id_user");
string username = reader.GetString("userName");
string email = reader.GetString("email");
bool isApproved = reader.GetBoolean("approved");
bool isLockedOut = reader.GetBoolean("locked");
DateTime createdDate = reader.GetDateTime("creationDate");
DateTime lastLoginDate = reader["lastLoginDate"] != DBNull.Value ? reader.GetDateTime("lastLoginDate") : DateTime.MinValue;
DateTime lastActivityDate = reader["lastActivityDate"] != DBNull.Value ? reader.GetDateTime("lastActivityDate") : DateTime.MinValue;
DateTime lastLockedDate = reader["lastLockedDate"] != DBNull.Value ? reader.GetDateTime("lastLockedDate") : DateTime.MinValue;
DateTime lastPasswordChangedDate = reader["lastPasswordChangedDate"] != DBNull.Value ? reader.GetDateTime("lastPasswordChangedDate") : DateTime.MinValue;
return new MembershipUser("PureMembershipProvider", username, null, email, null, null, isApproved,
isLockedOut, createdDate, lastLoginDate, lastActivityDate, lastPasswordChangedDate,
lastLockedDate);
//return new PureMembershipUser(id_user, username, email, isApproved, isLockedOut,
// createdDate, lastLoginDate, lastActivityDate, lastPasswordChangedDate, lastLockedDate);
}
示例10: MapLeague
private static League MapLeague(MySqlDataReader dr)
{
return new League
{
Created = dr.GetDateTime("created"),
CreatorUserId = dr.GetInt64("creatorUserId"),
CreatorUserName = dr.GetString("creatorUserName"),
Id = dr.GetInt64("id"),
IsActive = dr.GetBoolean("active"),
Name = dr.GetString("name"),
OwnerUserId = dr.GetInt64("ownerUserId"),
OwnerUserName = dr.GetString("ownerUserName"),
Sport = (SportType) dr.GetInt32("sportId")
};
}
示例11: findByPersonnameAndPersonemail
public void findByPersonnameAndPersonemail()
{
db = new Database();
personQuery = new MySqlCommand();
personQuery.Connection = db.Connection();
personQuery.CommandText = "SELECT * FROM person WHERE personname = @Name AND personemail = @Email";
personQuery.Prepare();
personQuery.Parameters.AddWithValue("@Name", personname);
personQuery.Parameters.AddWithValue("@Email", personemail);
personResult = personQuery.ExecuteReader();
while (personResult.Read())
{
if (!personResult.IsDBNull(0))
{
idperson = personResult.GetInt32(0);
}
if (!personResult.IsDBNull(1))
{
personname = personResult.GetString(1);
}
if (!personResult.IsDBNull(2))
{
personemail = personResult.GetString(2);
}
else
{
personemail = null;
}
if (!personResult.IsDBNull(3))
{
personstate = personResult.GetBoolean(3);
}
}
db.Close();
}
示例12: GetUserFromReader
//
// GetUserFromReader
// A helper function that takes the current row from the MySqlDataReader
// and hydrates a MembershiUser from the values. Called by the
// MembershipUser.GetUser implementation.
//
private MembershipUser GetUserFromReader(MySqlDataReader reader)
{
object providerUserKey = new Guid(reader.GetValue(0).ToString());
string username = reader.IsDBNull(1) ? "" : reader.GetString(1);
string email = reader.IsDBNull(2) ? "" : reader.GetString(2);
string passwordQuestion = reader.IsDBNull(3) ? "" : reader.GetString(3);
string comment = reader.IsDBNull(4) ? "" : reader.GetString(4);
bool isApproved = reader.IsDBNull(5) ? false : reader.GetBoolean(5);
bool isLockedOut = reader.IsDBNull(6) ? false : reader.GetBoolean(6);
DateTime creationDate = reader.IsDBNull(7) ? DateTime.Now : reader.GetDateTime(7);
DateTime lastLoginDate = reader.IsDBNull(8) ? DateTime.Now : reader.GetDateTime(8);
DateTime lastActivityDate = reader.IsDBNull(9) ? DateTime.Now : reader.GetDateTime(9);
DateTime lastPasswordChangedDate = reader.IsDBNull(10) ? DateTime.Now : reader.GetDateTime(10);
DateTime lastLockedOutDate = reader.IsDBNull(11) ? DateTime.Now : reader.GetDateTime(11);
return new MembershipUser(
this.Name,
username,
providerUserKey,
email,
passwordQuestion,
comment,
isApproved,
isLockedOut,
creationDate,
lastLoginDate,
lastActivityDate,
lastPasswordChangedDate,
lastLockedOutDate
);
}
示例13: ProcessRow
protected Blocked_timeslot ProcessRow(MySqlDataReader Reader, Blocked_timeslot blockedTimeSlot)
{
blockedTimeSlot.Daytime_id = Reader.GetInt32(0);
blockedTimeSlot.Hardblock = Reader.GetBoolean(1);
return blockedTimeSlot;
}
示例14: findAll
public void findAll()
{
db = new Database();
persons.Clear();
personQuery = new MySqlCommand();
personQuery.Connection = db.Connection();
personQuery.CommandText = "SELECT * FROM person ORDER BY personname ASC";
personResult = personQuery.ExecuteReader();
while (personResult.Read())
{
if (!personResult.IsDBNull(0))
{
idperson = personResult.GetInt32(0);
}
if (!personResult.IsDBNull(1))
{
personname = personResult.GetString(1);
}
if (!personResult.IsDBNull(2))
{
personemail = personResult.GetString(2);
}
else
{
personemail = null;
}
if (!personResult.IsDBNull(3))
{
personstate = personResult.GetBoolean(3);
}
persons.Add(new Person { idperson = this.idperson, personname = this.personname, personemail = this.personemail, personstate = this.personstate });
}
db.Close();
}
示例15: LoadFromReader
public void LoadFromReader(MySqlDataReader _reader)
{
m_id = _reader["id"].GetType() != typeof(System.DBNull) ? _reader.GetInt64("id") : 0;
mc_id = false;
m_title = _reader["title"].GetType() != typeof(System.DBNull) ? _reader.GetString("title") : "";
mc_title = false;
m_url = _reader["url"].GetType() != typeof(System.DBNull) ? _reader.GetString("url") : "";
mc_url = false;
m_proto_name = _reader["proto_name"].GetType() != typeof(System.DBNull) ? _reader.GetString("proto_name") : "";
mc_proto_name = false;
m_order_number = _reader["order_number"].GetType() != typeof(System.DBNull) ? _reader.GetInt32("order_number") : 0;
mc_order_number = false;
m_show_gallery = _reader["show_gallery"].GetType() != typeof(System.DBNull) ? _reader.GetBoolean("show_gallery") : false;
mc_show_gallery = false;
m_show_map = _reader["show_map"].GetType() != typeof(System.DBNull) ? _reader.GetBoolean("show_map") : false;
mc_show_map = false;
m_show_in_anounce = _reader["show_in_anounce"].GetType() != typeof(System.DBNull) ? _reader.GetBoolean("show_in_anounce") : false;
mc_show_in_anounce = false;
}