You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

96 lines
3.3 KiB

  1. using Apewer;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Data;
  5. namespace Apewer.Source
  6. {
  7. /// <summary>查询数据表。</summary>
  8. public interface IQuery : IDisposable
  9. {
  10. #region 结果集的属性。
  11. /// <summary>语句执行成功。</summary>
  12. bool Success { get; }
  13. /// <summary>错误信息。</summary>
  14. string Error { get; }
  15. /// <summary>消息。</summary>
  16. string Message { get; }
  17. /// <summary>语句执行失败时的 Exception 对象。</summary>
  18. Exception Exception { get; }
  19. /// <summary>所有结果表。</summary>
  20. List<DataTable> Tables { get; }
  21. /// <summary>获取默认结果表。如果设置默认结果表,会丢失设置前的所有结果表。</summary>
  22. DataTable Table { get; }
  23. /// <summary>结果集为空。</summary>
  24. bool Empty { get; }
  25. /// <summary>默认表中的数据总行数。</summary>
  26. int Rows { get; }
  27. /// <summary>默认表中的数据总列数。</summary>
  28. int Columns { get; }
  29. #endregion
  30. #region 以对象获取结果集中的内容。
  31. /// <summary>获取默认表中第 0 行、第 0 列的单元格内容。</summary>
  32. object Value();
  33. /// <summary>获取默认表中指定行中第 0 列的内容。</summary>
  34. /// <param name="rowIndex">行索引,从 0 开始。</param>
  35. object Value(int rowIndex);
  36. /// <summary>获取默认表中第 0 行指定列的内容。</summary>
  37. /// <param name="columnName">列名称。</param>
  38. object Value(string columnName);
  39. /// <summary>获取默认表中指定单元的内容。</summary>
  40. /// <param name="rowIndex">行索引,从 0 开始。</param>
  41. /// <param name="columnIndex">列索引,从 0 开始。</param>
  42. object Value(int rowIndex, int columnIndex);
  43. /// <summary>获取默认表中指定单元的内容。</summary>
  44. /// <param name="rowIndex">行索引,从 0 开始。</param>
  45. /// <param name="columnName">列名称。</param>
  46. object Value(int rowIndex, string columnName);
  47. #endregion
  48. #region 以文本获取结果集中的内容。
  49. /// <summary>获取默认表中第 0 行、第 0 列的单元格内容。</summary>
  50. string Text();
  51. /// <summary>获取默认表中指定行中第 0 列的内容。</summary>
  52. /// <param name="rowIndex">行索引,从 0 开始。</param>
  53. string Text(int rowIndex);
  54. /// <summary>获取默认表中第 0 行指定列的内容。</summary>
  55. /// <param name="columnName">列名称。</param>
  56. string Text(string columnName);
  57. /// <summary>获取默认表中指定单元格的内容。</summary>
  58. /// <param name="rowIndex">行索引,从 0 开始。</param>
  59. /// <param name="columnIndex">列索引,从 0 开始。</param>
  60. string Text(int rowIndex, int columnIndex);
  61. /// <summary>获取默认表中指定单元的内容。</summary>
  62. /// <param name="rowIndex">行索引,从 0 开始。</param>
  63. /// <param name="columnName">列名称。</param>
  64. string Text(int rowIndex, string columnName);
  65. #endregion
  66. }
  67. }