DataBase.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Collections.Specialized;
  4. using System.Text;
  5. using FastReport.Data;
  6. namespace FastReport.FastQueryBuilder
  7. {
  8. internal class DataBase
  9. {
  10. private Query tableList = new Query();
  11. public DataConnectionBase dataBase;
  12. private static int CompareTable(Table x, Table y)
  13. {
  14. return x.Name.CompareTo(y.Name);
  15. }
  16. public DataBase(DataConnectionBase db)
  17. {
  18. dataBase = db;
  19. try
  20. {
  21. dataBase.CreateAllTables(false);
  22. }
  23. catch
  24. {
  25. }
  26. foreach (TableDataSource tds in dataBase.Tables)
  27. {
  28. Table tbl = new Table(tds);
  29. tbl.Name = tbl.Name;
  30. tableList.tableList.Add(tbl);
  31. }
  32. tableList.tableList.Sort(CompareTable);
  33. }
  34. public string GetQuotationChars()
  35. {
  36. return dataBase.GetQuotationChars();
  37. }
  38. public List<Table> GetTableList()
  39. {
  40. return tableList.tableList;
  41. }
  42. }
  43. }