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


C# SQLiteAsyncConnection.DropTableAsync方法代码示例

本文整理汇总了C#中SQLite.SQLiteAsyncConnection.DropTableAsync方法的典型用法代码示例。如果您正苦于以下问题:C# SQLiteAsyncConnection.DropTableAsync方法的具体用法?C# SQLiteAsyncConnection.DropTableAsync怎么用?C# SQLiteAsyncConnection.DropTableAsync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SQLite.SQLiteAsyncConnection的用法示例。


在下文中一共展示了SQLiteAsyncConnection.DropTableAsync方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: loadData

        private async void loadData()
        {
            //SQLiteAsyncConnection conn1 = new SQLiteAsyncConnection(System.IO.Path.Combine(ApplicationData.Current.LocalFolder.Path, "Appointment.db"), true);

            
            SQLiteAsyncConnection conn = new SQLiteAsyncConnection(System.IO.Path.Combine(ApplicationData.Current.LocalFolder.Path, "Appointment.db"), true);
            conn.DropTableAsync<SampleAppointment>();

            await conn.CreateTableAsync<SampleAppointment>();

            DateTime temp = DateTime.Now;

            DateTime start = DateTime.Parse("06/08/2013 6:00 PM");
            DateTime end = DateTime.Parse("06/09/2013 6:00 PM");

            SampleAppointment appointment1 = new SampleAppointment
            {
                Subject = "MACF - App Camp",
                AdditionalInfo = "BRTN 291, RSVP Reguired",
                StartDate = start,
                EndDate = end
            };

            conn.InsertAsync(appointment1);

            SampleAppointment appointment2 = new SampleAppointment
            {
                StartDate = DateTime.Now.AddMinutes(30),
                EndDate = DateTime.Now.AddHours(1),
                Subject = "Appointment 376",
                AdditionalInfo = "Info 3"
            };

            conn.InsertAsync(appointment2);

            start = DateTime.Parse("06/05/2013 5:00 PM");
            end = DateTime.Parse("06/05/2013 6:00 PM");
            SampleAppointment appointment3 = new SampleAppointment
            {
                StartDate = DateTime.Now.AddHours(2),
                EndDate = DateTime.Now.AddHours(3),
                Subject = "Appointment uhy4",
                AdditionalInfo = "Info 4"
            };

            conn.InsertAsync(appointment3);

            SampleAppointment appointment4 = new SampleAppointment
            {
                Subject = "Malaysian Night",
                AdditionalInfo = "STEW Common, Members Only",
                StartDate = start,
                EndDate = end
            };

            conn.InsertAsync(appointment4);

            //this.OnDataLoaded();
        }
开发者ID:KIshen90,项目名称:FreeFoodEngine,代码行数:59,代码来源:CalendarPage.xaml.cs

示例2: connectDB

        async Task<int> connectDB()
        {
            var path = Windows.Storage.ApplicationData.Current.LocalFolder.Path + @"\beyondvincent.db";

            db = new SQLiteAsyncConnection(path);
            await db.DropTableAsync<User>();
            await db.CreateTableAsync<User>();
            return 0;
        }
开发者ID:BeyondVincent,项目名称:WindowsStoreAppCode,代码行数:9,代码来源:MainPage.xaml.cs

示例3: DropTableAsync

 private async Task DropTableAsync(string name)
 {
     SQLiteAsyncConnection conn = new SQLiteAsyncConnection("moneybook.db");
     await conn.DropTableAsync<taikhoan>();
 }
开发者ID:tungnt92,项目名称:MoneyBookWP,代码行数:5,代码来源:MainPage.xaml.cs

示例4: DeleteMessages

		public async Task DeleteMessages()
		{
			var connection = new SQLiteAsyncConnection(_databasePath);
			await connection.DropTableAsync<Message> ();
			await connection.CreateTableAsync<Message> ();
		}
开发者ID:ezeh2,项目名称:ezeh2.github.io,代码行数:6,代码来源:MessageRepository.cs

示例5: DeleteDatabaseAsync

 public static async Task DeleteDatabaseAsync()
 {
     SQLiteAsyncConnection conn = new SQLiteAsyncConnection(Windows.Storage.ApplicationData.Current.LocalFolder.Path + "\\Data.db");          
     await conn.DropTableAsync<Course>();
     await conn.DropTableAsync<Term>();
     await conn.DropTableAsync<Exam>();
     await conn.DropTableAsync<Lesson>();
     Term.ClearData();
     Exam.ClearData();
     WeekDay.ClearData();
 }
开发者ID:CuiXiaoDao,项目名称:ZJUTimetable,代码行数:11,代码来源:Grades.cs

示例6: UpdateDataAsync

        public static async Task<bool> UpdateDataAsync()
        {
            bool updated = false;
            WebHelper webHelper = new WebHelper();

            if (await webHelper.getAllData())
            {
                SQLiteAsyncConnection conn = new SQLiteAsyncConnection(Windows.Storage.ApplicationData.Current.LocalFolder.Path + "\\Data.db");
                await conn.DropTableAsync<Term>();
                await conn.DropTableAsync<Lesson>();
                await conn.DropTableAsync<Exam>();//删除之前的数据
                await conn.DropTableAsync<Course>();//不提示成绩更新情况下,直接删除成绩
                await conn.CreateTablesAsync<Course, Term, Lesson, Exam>();

                await conn.InsertAllAsync(webHelper.Exams);//update exams; 
                await conn.InsertAllAsync(webHelper.Terms);
                await conn.InsertAllAsync(webHelper.Lessons);
                await conn.InsertAllAsync(webHelper.Courses);
                Term.ClearData();
                Exam.ClearData();
                WeekDay.ClearData();

                updated = true;
            }

            return updated;
            ////区分有无成绩更新,方便后续扩展出成绩提示
            //var previousCourses = terms.SelectMany(term => term.Courses);

            //var updateCourses = from course in webHelper.Courses
            //                    let previousCourse = from tempCourse in previousCourses
            //                                         where tempCourse.CourseName == course.CourseName &&
            //                                         tempCourse.TermNumber == course.TermNumber &&
            //                                         (tempCourse.GradePoints != course.GradePoints | tempCourse.MakeUpExamGrades != course.MakeUpExamGrades)
            //                                         select tempCourse
            //                    where previousCourse.Any()
            //                    select course;

            //var newCourses = from course in webHelper.Courses
            //                 let previousCourse = from tempCourse in previousCourses
            //                                      where tempCourse.CourseName == course.CourseName &&
            //                                      tempCourse.TermNumber == course.TermNumber
            //                                      select tempCourse
            //                 where !previousCourse.Any()
            //                 select course;

            //var updatedCourse = updateCourses.ToList();
            // var newcourses = newCourses.ToList();
            //if (updateCourses.Any() | newCourses.Any())
            //{
            //    try
            //    {
            //        await conn.InsertAllAsync(newCourses);
            //        await conn.UpdateAllAsync(updateCourses);

            //    }
            //    catch (Exception)
            //    {
            //        await conn.DropTableAsync<Course>();
            //        var message = new Windows.UI.Popups.MessageDialog("更新本地数据出错,建议或重试,或进入设置删除本地账号和数据或重启应用后再导入");
            //        await message.ShowAsync();
            //    }
            //    updated = true;
            //}
        }
开发者ID:CuiXiaoDao,项目名称:ZJUTimetable,代码行数:65,代码来源:Grades.cs

示例7: DropDatabase

 /// <summary>
 /// Delete the database
 /// </summary>
 public async void DropDatabase()
 {
     SQLiteAsyncConnection connection = new SQLiteAsyncConnection(textBox.Text);
     await connection.DropTableAsync<Sensor>();
 }
开发者ID:Robotonics,项目名称:iotSampler,代码行数:8,代码来源:MainPage.xaml.cs

示例8: DropTableAsync

 private async Task DropTableAsync(string name)
 {
     SQLiteAsyncConnection conn = new SQLiteAsyncConnection(dbName);
     await conn.DropTableAsync<Article>();
 }
开发者ID:luiseduardohdbackup,项目名称:Windows-Universal,代码行数:5,代码来源:MainPage.xaml.cs


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