本文整理汇总了C#中MySql.Data.MySqlClient.MySqlTransaction.ExecuteScalar方法的典型用法代码示例。如果您正苦于以下问题:C# MySqlTransaction.ExecuteScalar方法的具体用法?C# MySqlTransaction.ExecuteScalar怎么用?C# MySqlTransaction.ExecuteScalar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MySql.Data.MySqlClient.MySqlTransaction
的用法示例。
在下文中一共展示了MySqlTransaction.ExecuteScalar方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InsertMissingLeaderboard
private static void InsertMissingLeaderboard(MySqlTransaction tran)
{
string lastValidPoll = DatabaseExtender.Cast<string>(tran.ExecuteScalar("SELECT data FROM squid_logs_stages_info WHERE is_valid = 1 ORDER BY start_date DESC LIMIT 1"));
int newStages, newWeapons,
newShoes, newClothes, newHead;
StagesInfoRecord[] records = GetStagesInfo(lastValidPoll);
StagesInfoRecord record = records[0];
bool success = false;
if (IsRecordValid(record))
{
success = Database.InsertLeaderboard(tran, record,
out newStages, out newWeapons, out newShoes, out newClothes, out newHead);
}
if (success)
{
Console.WriteLine("Inserted leaderboard for {0} to {1}.", record.datetime_term_begin, record.datetime_term_end);
}
}