当前位置: 首页>>代码示例>>C#>>正文


C# SQLiteAsyncConnection.CreateTablesAsync方法代码示例

本文整理汇总了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;
            }
        }
开发者ID:KeesPolling,项目名称:Popmail,代码行数:33,代码来源:Database.cs

示例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);
		}
开发者ID:Boxical,项目名称:mobile-samples,代码行数:23,代码来源:MainActivity.cs


注:本文中的SQLiteAsyncConnection.CreateTablesAsync方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。