本文整理汇总了C#中SQLiteAsyncConnection.CreateTablesAsync方法的典型用法代码示例。如果您正苦于以下问题:C# SQLiteAsyncConnection.CreateTablesAsync方法的具体用法?C# SQLiteAsyncConnection.CreateTablesAsync怎么用?C# SQLiteAsyncConnection.CreateTablesAsync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SQLiteAsyncConnection
的用法示例。
在下文中一共展示了SQLiteAsyncConnection.CreateTablesAsync方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateDatabaseAsync
private static SQLiteAsyncConnection CreateDatabaseAsync()
{
// Create a new connection
try
{
var platform = new SQLite.Net.Platform.WinRT.SQLitePlatformWinRT();
var dbPath = Path.Combine(ApplicationData.Current.LocalFolder.Path,"Storage.SQLite");
var connectionString = new SQLiteConnectionString(dbPath, true);
var dbLockedCon = new SQLiteConnectionWithLock(platform ,connectionString);
var db = new SQLiteAsyncConnection(() => dbLockedCon);
//Create the tables that do not exist
Type[] tables =
{
typeof(Folders)
, typeof(Accounts)
, typeof(Emails)
, typeof(EmailFrom)
, typeof(EmailSender)
, typeof(EmailReplyTo)
, typeof(Settings)
};
var d = db.CreateTablesAsync(tables).Result;
return db;
}
catch(Exception e)
{
var mess = e.Message;
throw;
}
}
示例2: OnCreate
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);
RequestWindowFeature (WindowFeatures.ActionBar);
RequestWindowFeature (WindowFeatures.Progress);
RequestWindowFeature (WindowFeatures.IndeterminateProgress);
SetProgressBarIndeterminate (true);
SetProgressBarIndeterminateVisibility (true);
ActionBar.NavigationMode = ActionBarNavigationMode.Tabs;
ActionBar.Title = "Tasks Example";
ActionBar.SetDisplayShowTitleEnabled (true);
if (bundle != null)
this.selectedId = bundle.GetString ("selected");
DB = new SQLiteAsyncConnection (Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.Personal), "todo.db"));
// Create our tables
DB.CreateTablesAsync<List, ListItem>().ContinueWith (t => LoadLists(), uiScheduler);
}