OdbcColumn.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. using System;
  2. namespace System.Data.Odbc
  3. {
  4. /// <summary>
  5. /// Summary description for OdbcColumn.
  6. /// </summary>
  7. internal class OdbcColumn
  8. {
  9. internal string ColumnName;
  10. internal OdbcType OdbcType;
  11. internal bool AllowDBNull;
  12. internal int MaxLength;
  13. internal int Digits;
  14. internal object Value;
  15. internal OdbcColumn(string Name, OdbcType Type)
  16. {
  17. this.ColumnName=Name;
  18. this.OdbcType=Type;
  19. }
  20. internal Type DataType
  21. {
  22. get
  23. {
  24. return libodbchelper.ODBCTypeToCILType(OdbcType);
  25. }
  26. }
  27. internal bool IsDateType
  28. {
  29. get
  30. {
  31. switch (OdbcType)
  32. {
  33. case OdbcType.Time:
  34. case OdbcType.Timestamp:
  35. case OdbcType.DateTime:
  36. case OdbcType.Date:
  37. case OdbcType.SmallDateTime:
  38. return true;
  39. default:
  40. return false;
  41. }
  42. }
  43. }
  44. internal bool IsStringType
  45. {
  46. get
  47. {
  48. switch (OdbcType)
  49. {
  50. case OdbcType.Text:
  51. case OdbcType.NText:
  52. case OdbcType.NVarChar:
  53. case OdbcType.VarChar:
  54. return true;
  55. default:
  56. return false;
  57. }
  58. }
  59. }
  60. }
  61. }