本文整理汇总了C#中SQLite.SQLiteAsyncConnection.ExecuteAsync方法的典型用法代码示例。如果您正苦于以下问题:C# SQLiteAsyncConnection.ExecuteAsync方法的具体用法?C# SQLiteAsyncConnection.ExecuteAsync怎么用?C# SQLiteAsyncConnection.ExecuteAsync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SQLite.SQLiteAsyncConnection
的用法示例。
在下文中一共展示了SQLiteAsyncConnection.ExecuteAsync方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: update
public async void update()
{
SQLiteAsyncConnection connection = new SQLiteAsyncConnection("Test.db");
await connection.ExecuteAsync("UPDATE Employee SET Skill=\"" + Skill + "\" WHERE BadgeId=\"" + BadgeId+"\"");
var addmsg = new MessageDialog("Your SkillSet has been updated!");
await addmsg.ShowAsync();
}
示例2: ConnectionInit
/// <summary>
/// Initialise the Database connection and creates tables/default values if not existant.
/// </summary>
private async void ConnectionInit()
{
//Connection init
var dbPath = Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path, "db.sqlite");
Database = new SQLite.SQLiteAsyncConnection(dbPath);
//Create tables if not exists
await Database.CreateTablesAsync(new Account().GetType(), new DatabaseRoute().GetType(), new DatabasePOI().GetType());
await Database.ExecuteAsync("create table if not exists \"RouteBinds\"(\"RouteID\" integer,\"WaypointID\" integer);", new object[] { });
//Set default Admin Admin password
var result = await Database.ExecuteScalarAsync<String>("Select Gebruikersnaam From Account WHERE Gebruikersnaam = ? AND Password = ?", new object[] { "Admin", "Admin" });
if(result == null)
await Database.InsertAsync(new Account("Admin", "Admin"));
}
示例3: Clear
public async Task Clear()
{
var connection = new SQLiteAsyncConnection(DbPath);
await connection.ExecuteAsync("DELETE FROM TracklistItem");
}
示例4: Remove
public Task Remove(int trackId, int trackCollectionId)
{
var connection = new SQLiteAsyncConnection(DbPath);
return connection.ExecuteAsync("DELETE FROM TracklistItem WHERE TrackCollectionId=? AND TrackId=?;", trackCollectionId, trackId);
}
示例5: CreateTables
/// <summary>
/// Method to create tables into database.
/// </summary>
/// <param name="db">Database connection for async calls.</param>
/// <returns><see cref="Task"/></returns>
protected async Task CreateTables(SQLiteAsyncConnection db)
{
await Task.Run(async () =>
{
///Tables:
await db.CreateTableAsync<Zip>();
await db.ExecuteAsync(string.Format("PRAGMA user_version = {0};", CURRENT_DB_VERSION));
});
}
示例6: RemoveLocation
public Task RemoveLocation(MapLocationModel mapLocation)
{
SQLiteAsyncConnection connection = new SQLiteAsyncConnection(SQLiteConfiguration.ConnectionString);
_locations.Remove(mapLocation);
connection.ExecuteAsync("DELETE FROM MapLocationFolders WHERE MapLocationId = ?", mapLocation.ID);
return connection.DeleteAsync(mapLocation);
}
示例7: RemoveLocationFolders
public Task RemoveLocationFolders(List<MapLocationFolderModel> locationFolders)
{
string query = "DELETE FROM MapLocationFolders WHERE ID IN (" +
locationFolders.Aggregate(string.Empty, (current, next) =>
{
_locationFolders.Remove(next);
return current + "'" + next.ID + "',";
}).TrimEnd(',') + ")";
SQLiteAsyncConnection connection = new SQLiteAsyncConnection(SQLiteConfiguration.ConnectionString);
return connection.ExecuteAsync(query);
}