本文整理汇总了C#中MySql.Data.MySqlClient.MySqlDataReader.GetInt64方法的典型用法代码示例。如果您正苦于以下问题:C# MySqlDataReader.GetInt64方法的具体用法?C# MySqlDataReader.GetInt64怎么用?C# MySqlDataReader.GetInt64使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MySql.Data.MySqlClient.MySqlDataReader
的用法示例。
在下文中一共展示了MySqlDataReader.GetInt64方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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;
}
示例2: 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();
}
示例3: LoadFromReader
public void LoadFromReader(MySqlDataReader _reader)
{
m_id = _reader["id"].GetType() != typeof(System.DBNull) ? _reader.GetInt64("id") : 0;
mc_id = false;
m_entity_id = _reader["entity_id"].GetType() != typeof(System.DBNull) ? _reader.GetInt64("entity_id") : 0;
mc_entity_id = false;
m_proto_name = _reader["proto_name"].GetType() != typeof(System.DBNull) ? _reader.GetString("proto_name") : "";
mc_proto_name = false;
m_url = _reader["url"].GetType() != typeof(System.DBNull) ? _reader.GetString("url") : "";
mc_url = false;
m_title = _reader["title"].GetType() != typeof(System.DBNull) ? _reader.GetString("title") : "";
mc_title = false;
m_keywords = _reader["keywords"].GetType() != typeof(System.DBNull) ? _reader.GetString("keywords") : "";
mc_keywords = false;
m_description = _reader["description"].GetType() != typeof(System.DBNull) ? _reader.GetString("description") : "";
mc_description = false;
}
示例4: setProperty
public void setProperty(MySqlDataReader reader)
{
this._Name = reader.GetString(reader.GetOrdinal("Name"));
this._Engine = reader.GetString(reader.GetOrdinal("Engine"));
this._Version = reader.GetInt64(reader.GetOrdinal("Version"));
this._Row_format = reader.GetString(reader.GetOrdinal("Row_format"));
if (!reader.IsDBNull(reader.GetOrdinal("Rows")))
{
this._Rows = reader.GetInt64(reader.GetOrdinal("Rows"));
}
this._Avg_row_length = reader.GetInt64(reader.GetOrdinal("Avg_row_length"));
this._Data_length = reader.GetInt64(reader.GetOrdinal("Data_length"));
this._Max_data_length = reader.GetInt64(reader.GetOrdinal("Max_data_length"));
this._Index_length = reader.GetInt64(reader.GetOrdinal("Index_length"));
this._Data_free = reader.GetInt64(reader.GetOrdinal("Data_free"));
if (!reader.IsDBNull(reader.GetOrdinal("Auto_increment")))
{
this._Auto_increment = reader.GetInt64(reader.GetOrdinal("Auto_increment"));
}
if (!reader.IsDBNull(reader.GetOrdinal("Create_time")))
{
this._Create_time = reader.GetDateTime(reader.GetOrdinal("Create_time"));
}
if (!reader.IsDBNull(reader.GetOrdinal("Update_time")))
{
this._Update_time = reader.GetDateTime(reader.GetOrdinal("Update_time"));
}
if (!reader.IsDBNull(reader.GetOrdinal("Check_time")))
{
this._Check_time = reader.GetDateTime(reader.GetOrdinal("Check_time"));
}
this._Collation = reader.GetString(reader.GetOrdinal("Collation"));
if (!reader.IsDBNull(reader.GetOrdinal("Checksum")))
{
this._Checksum = reader.GetInt64(reader.GetOrdinal("Checksum"));
}
this._Create_options = reader.GetString(reader.GetOrdinal("Create_options"));
this._Comment = reader.GetString(reader.GetOrdinal("Comment"));
}
示例5: MapUserRecord
private static UserRecord MapUserRecord(MySqlDataReader dr)
{
var record = new UserRecord();
record.Id = dr.GetInt64("id");
record.LastUpdated = dr.GetDateTime("lastUpdated");
record.Losses = dr.GetInt32("losses");
record.RecordType = (RecordType)dr.GetInt32("type");
record.Ties = dr.GetInt32("ties");
record.UserId = dr.GetInt64("userId");
record.UserName = dr.GetString("userName");
record.Wins = dr.GetInt32("wins");
if (!dr.IsDBNull(dr.GetOrdinal("season")))
{
record.Season = dr.GetInt32("season");
}
if (!dr.IsDBNull(dr.GetOrdinal("seasonType")))
{
record.SeasonType = (SeasonType) dr.GetInt32("seasonType");
}
if (!dr.IsDBNull(dr.GetOrdinal("week")))
{
record.Week = dr.GetInt32("week");
}
return record;
}
示例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_fieldsets = _reader["fieldsets"].GetType() != typeof(System.DBNull) ? _reader.GetString("fieldsets") : "";
mc_fieldsets = false;
m_announce_order = _reader["announce_order"].GetType() != typeof(System.DBNull) ? _reader.GetInt32("announce_order") : 0;
mc_announce_order = false;
m_show_in_announce = _reader["show_in_announce"].GetType() != typeof(System.DBNull) ? _reader.GetBoolean("show_in_announce") : false;
mc_show_in_announce = false;
m_controller = _reader["controller"].GetType() != typeof(System.DBNull) ? _reader.GetString("controller") : "";
mc_controller = false;
m_action = _reader["action"].GetType() != typeof(System.DBNull) ? _reader.GetString("action") : "";
mc_action = false;
}
示例7: MapUser
private static User MapUser(MySqlDataReader dr)
{
return new User
{
AuthToken = new AuthToken
{
Expiration = dr.GetDateTime("authTokenExpiration"),
Token = dr.GetString("authToken"),
UserId = dr.GetInt64("id"),
UserName = dr.GetString("userName")
},
Email = dr.GetString("email"),
JoinedOn = dr.GetDateTime("joinedOn"),
Id = dr.GetInt64("id"),
PasswordHash = dr.GetString("password"),
Salt = dr.GetString("salt"),
Status = (UserStatus) dr.GetInt32("statusID"),
UserName = dr.GetString("userName")
};
}
示例8: getLastId
//getLast inserted id method
public double getLastId()
{
double id = 0d;
string sql;
MySqlCommand comm = new MySqlCommand();
sql = "SELECT last_insert_id()";
comm.CommandText = sql;
comm.Connection = this.conn;
//this.reader = comm.ExecuteReader();
this.reader = this.execute(comm.CommandText);
while (reader.Read())
{
id = reader.GetInt64(0);
}
this.reader.Close();
return id;
}
示例9: 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;
}
示例10: MapLeagueMember
private static LeagueMember MapLeagueMember(MySqlDataReader dr)
{
return new LeagueMember
{
Id = dr.GetInt64("id"),
IsActive = dr.GetBoolean("active"),
Joined = dr.GetDateTime("joined"),
LeagueId = dr.GetInt64("leagueId"),
UserId = dr.GetInt64("userId"),
UserName = dr.GetString("userName")
};
}
示例11: LoadFromReader
public void LoadFromReader(MySqlDataReader _reader)
{
m_id = _reader["id"].GetType() != typeof(System.DBNull) ? _reader.GetInt64("id") : 0;
mc_id = false;
m_parent_id = _reader["parent_id"].GetType() != typeof(System.DBNull) ? _reader.GetInt64("parent_id") : 0;
mc_parent_id = false;
m_title = _reader["title"].GetType() != typeof(System.DBNull) ? _reader.GetString("title") : "";
mc_title = false;
m_publish_date = _reader["publish_date"].GetType() != typeof(System.DBNull) ? _reader.GetDateTime("publish_date") : DateTime.MinValue;
mc_publish_date = false;
m_html = _reader["html"].GetType() != typeof(System.DBNull) ? _reader.GetString("html") : "";
mc_html = false;
m_alias = _reader["alias"].GetType() != typeof(System.DBNull) ? _reader.GetString("alias") : "";
mc_alias = false;
}
示例12: 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")
};
}
示例13: MapInvitation
private static LeagueInvitation MapInvitation(MySqlDataReader dr)
{
var invite = new LeagueInvitation
{
Created = dr.GetDateTime("created"),
Email = dr.GetString("email"),
Id = dr.GetInt64("id"),
InvitationToken = dr.GetString("inviteToken"),
LeagueId = dr.GetInt64("leagueId"),
SentByUserId = dr.GetInt64("sentByUserId"),
Status = (InviteStatus) dr.GetInt32("status")
};
var userIdOrdinal = dr.GetOrdinal("userId");
var inviteSentOnOrdinal = dr.GetOrdinal("inviteSentOn");
var acceptedOnOrdinal = dr.GetOrdinal("acceptedOn");
if (!dr.IsDBNull(userIdOrdinal))
{
invite.UserId = dr.GetInt64("userId");
}
if (!dr.IsDBNull(inviteSentOnOrdinal))
{
invite.InviteSentOn = dr.GetDateTime("inviteSentOn");
}
if (!dr.IsDBNull(acceptedOnOrdinal))
{
invite.AcceptedOn = dr.GetDateTime("acceptedOn");
}
return invite;
}
示例14: MapUserPick
private static UserPick MapUserPick(MySqlDataReader dr)
{
var pick = new UserPick
{
GameId = dr.GetInt64("gameId"),
Id = dr.GetInt64("id"),
OptionId = dr.GetInt64("gameOptionId"),
OptionGroupId = dr.GetInt64("groupId"),
OptionType = (GameOptionType) dr.GetInt32("type"),
UserId = dr.GetInt64("userId")
};
var outcomeOrdinal = dr.GetOrdinal("outcome");
if (!dr.IsDBNull(outcomeOrdinal))
{
pick.Outcome = (OptionOutcome) dr.GetInt32(outcomeOrdinal);
}
return pick;
}
示例15: LoadFromReader
public void LoadFromReader(MySqlDataReader _reader)
{
m_id = _reader["id"].GetType() != typeof(System.DBNull) ? _reader.GetInt64("id") : 0;
mc_id = false;
m_entity_id = _reader["entity_id"].GetType() != typeof(System.DBNull) ? _reader.GetInt64("entity_id") : 0;
mc_entity_id = false;
m_proto_name = _reader["proto_name"].GetType() != typeof(System.DBNull) ? _reader.GetString("proto_name") : "";
mc_proto_name = false;
m_field_id = _reader["field_id"].GetType() != typeof(System.DBNull) ? _reader.GetInt64("field_id") : 0;
mc_field_id = false;
m_field_value = _reader["field_value"].GetType() != typeof(System.DBNull) ? _reader.GetString("field_value") : "";
mc_field_value = false;
}