本文整理汇总了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();
}
示例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;
}
示例3: DropTableAsync
private async Task DropTableAsync(string name)
{
SQLiteAsyncConnection conn = new SQLiteAsyncConnection("moneybook.db");
await conn.DropTableAsync<taikhoan>();
}
示例4: DeleteMessages
public async Task DeleteMessages()
{
var connection = new SQLiteAsyncConnection(_databasePath);
await connection.DropTableAsync<Message> ();
await connection.CreateTableAsync<Message> ();
}
示例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();
}
示例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;
//}
}
示例7: DropDatabase
/// <summary>
/// Delete the database
/// </summary>
public async void DropDatabase()
{
SQLiteAsyncConnection connection = new SQLiteAsyncConnection(textBox.Text);
await connection.DropTableAsync<Sensor>();
}
示例8: DropTableAsync
private async Task DropTableAsync(string name)
{
SQLiteAsyncConnection conn = new SQLiteAsyncConnection(dbName);
await conn.DropTableAsync<Article>();
}