Ejemplo n.º 1
0
 public string FindAndSort(string file, string sql, string sortKeys = "")
 {
     try
     {
         if (!System.IO.File.Exists(file))
         {
             Console.WriteLine(string.Format("文件不存在", file));
             return(null);
         }
         SqliteContext context = new SqliteContext(file);
         var           list    = context.FindDataTableAndSort(sql, sortKeys);
         this.Encode(list, string.Empty, string.Empty);
         return(JsonConvert.SerializeObject(list));
     }
     catch (Exception ex)
     {
         Console.WriteLine(string.Format("SQL查询失败", file, ex.Message));
         throw;
     }
 }