本文整理汇总了C#中SQLiteDatabase.GetTables方法的典型用法代码示例。如果您正苦于以下问题:C# SQLiteDatabase.GetTables方法的具体用法?C# SQLiteDatabase.GetTables怎么用?C# SQLiteDatabase.GetTables使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SQLiteDatabase
的用法示例。
在下文中一共展示了SQLiteDatabase.GetTables方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DumpSqlite
static void DumpSqlite(string filename)
{
Serializer s = new Serializer();
try
{
var db = new SQLiteDatabase(filename);
List <String> tableList = db.GetTables();
List<SerializableDictionary<string, string>> dictList = new List<SerializableDictionary<string, string>>();
foreach (string table in tableList)
{
String query = string.Format("select * from {0};", table);
DataTable recipe = db.GetDataTable(query);
foreach (DataRow r in recipe.Rows)
{
SerializableDictionary<string, string> item = new SerializableDictionary<string, string>();
foreach (DataColumn c in recipe.Columns)
{
item[c.ToString()] = r[c.ToString()].ToString();
}
dictList.Add(item);
}
s.Serialize(string.Format("{0}.xml", table), dictList, table);
dictList.Clear();
}
}
catch (Exception fail)
{
String error = "The following error has occurred:\n\n";
error += fail.Message + "\n\n";
}
}