本文整理匯總了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);
}
}