/// <summary>
 /// Initializes a new instance of the TableColumn class.
 /// </summary>
 /// <param name="name"></param>
 /// <param name="dataType"></param>
 /// <param name="length"></param>
 /// <param name="allowNull"></param>
 public TableColumn(string name, GenericDbColumnType dataType, int length, bool allowNull)
 {
     this.name      = name;
     this.dataType  = dataType;
     this.length    = length;
     this.allowNull = allowNull;
 }
 /// <summary>
 /// Initializes a new instance of the TableColumn class.
 /// </summary>
 /// <param name="name"></param>
 /// <param name="dataType"></param>
 /// <param name="allowNull"></param>
 /// <param name="isPrimaryKey"></param>
 public TableColumn(string name, GenericDbColumnType dataType, bool allowNull, bool isPrimaryKey)
 {
     this.name         = name;
     this.dataType     = dataType;
     this.allowNull    = allowNull;
     this.isPrimaryKey = isPrimaryKey;
 }
Пример #3
0
 /// <summary>
 /// Initializes a new instance of the TableColumn class.
 /// </summary>
 /// <param name="name"></param>
 /// <param name="dataType"></param>
 /// <param name="allowNull"></param>
 /// <param name="isPrimaryKey"></param>
 public TableColumn(string name, GenericDbColumnType dataType, bool allowNull, bool isPrimaryKey)
 {
     this.name = name;
     this.dataType = dataType;
     this.allowNull = allowNull;
     this.isPrimaryKey = isPrimaryKey;
 }
 /// <summary>
 /// Initializes a new instance of the TableColumn class.
 /// </summary>
 /// <param name="name"></param>
 /// <param name="dataType"></param>
 /// <param name="precision"></param>
 /// <param name="scale"></param>
 /// <param name="allowNull"></param>
 public TableColumn(string name, GenericDbColumnType dataType, int precision, int scale, bool allowNull)
 {
     this.name      = name;
     this.dataType  = dataType;
     this.precision = precision;
     this.scale     = scale;
     this.allowNull = allowNull;
 }
 /// <summary>
 /// Initializes a new instance of the TableColumn class.
 /// </summary>
 /// <param name="name"></param>
 /// <param name="dataType"></param>
 /// <param name="allowNull"></param>
 /// <param name="foreignKeyTableName"></param>
 /// <param name="foreignKeyColumnName"></param>
 public TableColumn(string name, GenericDbColumnType dataType, bool allowNull, string foreignKeyTableName, string foreignKeyColumnName)
 {
     this.name                 = name;
     this.dataType             = dataType;
     this.allowNull            = allowNull;
     this.foreignKeyTableName  = foreignKeyTableName;
     this.foreignKeyColumnName = foreignKeyColumnName;
 }
Пример #6
0
 /// <summary>
 /// Initializes a new instance of the TableColumn class.
 /// </summary>
 /// <param name="name"></param>
 /// <param name="dataType"></param>
 /// <param name="allowNull"></param>
 /// <param name="foreignKeyTableName"></param>
 /// <param name="foreignKeyColumnName"></param>
 /// <param name="cascadeDelete">A value indicating whether or not to cascade on delete</param>
 public TableColumn(string name, GenericDbColumnType dataType, bool allowNull, string foreignKeyTableName, string foreignKeyColumnName, bool cascadeDelete)
 {
     this.name = name;
     this.dataType = dataType;
     this.allowNull = allowNull;
     this.foreignKeyTableName = foreignKeyTableName;
     this.foreignKeyColumnName = foreignKeyColumnName;
     this.cascadeDelete = cascadeDelete;
 }
 /// <summary>
 /// Initializes a new instance of the TableColumn class.
 /// </summary>
 /// <param name="name"></param>
 /// <param name="dataType"></param>
 /// <param name="precision"></param>
 /// <param name="scale"></param>
 /// <param name="allowNull"></param>
 /// <param name="foreignKeyTableName"></param>
 /// <param name="foreignKeyColumnName"></param>
 public TableColumn(string name, GenericDbColumnType dataType, int precision, int scale, bool allowNull, string foreignKeyTableName, string foreignKeyColumnName)
 {
     this.name                 = name;
     this.dataType             = dataType;
     this.precision            = precision;
     this.scale                = scale;
     this.allowNull            = allowNull;
     this.foreignKeyTableName  = foreignKeyTableName;
     this.foreignKeyColumnName = foreignKeyColumnName;
 }
Пример #8
0
 /// <summary>
 /// Initializes a new instance of the TableColumn class.
 /// </summary>
 /// <param name="name"></param>
 /// <param name="dataType"></param>
 /// <param name="precision"></param>
 /// <param name="scale"></param>
 /// <param name="allowNull"></param>
 /// <param name="isPrimaryKey"></param>
 public TableColumn(string name, GenericDbColumnType dataType, int precision, int scale, bool allowNull, bool isPrimaryKey)
 {
     this.name = name;
     this.dataType = dataType;
     this.precision = precision;
     this.scale = scale;
     this.allowNull = allowNull;
     this.isPrimaryKey = isPrimaryKey;
 }
Пример #9
0
        /// <summary>
        /// Set REDCap Data Type mapping
        /// </summary>
        /// <param name="dataType">DataType</param>
        /// <returns>String</returns>
        public override string GetDbSpecificColumnType(GenericDbColumnType dataType)
        {
            switch (dataType)
            {
            case GenericDbColumnType.AnsiString:
            case GenericDbColumnType.AnsiStringFixedLength:
            case GenericDbColumnType.Byte:
            case GenericDbColumnType.Guid:
            case GenericDbColumnType.String:
            case GenericDbColumnType.StringFixedLength:
                return("text");

            case GenericDbColumnType.Binary:
                return("binary");

            case GenericDbColumnType.Boolean:
                return("bool");

            case GenericDbColumnType.Currency:
            case GenericDbColumnType.Double:
                return("double");

            case GenericDbColumnType.Date:
                return("date");

            case GenericDbColumnType.DateTime:
                return("datetime");

            case GenericDbColumnType.Decimal:
                return("decimal");

            case GenericDbColumnType.Image:
                return("blob");

            case GenericDbColumnType.Int16:
            case GenericDbColumnType.UInt16:
                return("smallint");

            case GenericDbColumnType.Int32:
            case GenericDbColumnType.UInt32:
                return("integer");

            case GenericDbColumnType.Int64:
            case GenericDbColumnType.UInt64:
                return("bigint");

            case GenericDbColumnType.Object:
                return("blob");

            case GenericDbColumnType.SByte:
                return("tinyint");

            case GenericDbColumnType.Single:
                return("float");

            case GenericDbColumnType.StringLong:
                return("longtext");

            case GenericDbColumnType.Time:
                return("time");

            case GenericDbColumnType.VarNumeric:
                return("decimal");

            case GenericDbColumnType.Xml:
                return("mediumtext");

            default:
                throw new GeneralException("genericDbColumnType is unknown");
            }
        }
Пример #10
0
 public override string GetDbSpecificColumnType(GenericDbColumnType dataType)
 {
     throw new NotImplementedException();
 }
Пример #11
0
 /// <summary>
 /// Set MySQL Data Type mapping
 /// </summary>
 /// <param name="dataType">DataType</param>
 /// <returns>String</returns>
 public override string GetDbSpecificColumnType(GenericDbColumnType dataType)
 {
     switch (dataType)
     {
         case GenericDbColumnType.AnsiString:
         case GenericDbColumnType.AnsiStringFixedLength:
         case GenericDbColumnType.Byte:
         case GenericDbColumnType.Guid:
         case GenericDbColumnType.String:
         case GenericDbColumnType.StringFixedLength:
             return "text";
         case GenericDbColumnType.Binary:
             return "binary";
         case GenericDbColumnType.Boolean:
             return "bool";
         case GenericDbColumnType.Currency:
         case GenericDbColumnType.Double:
             return "double";
         case GenericDbColumnType.Date:
             return "date";
         case GenericDbColumnType.DateTime:
             return "datetime";
         case GenericDbColumnType.Decimal:
             return "decimal";
         case GenericDbColumnType.Image:
             return PostgreSQLDbColumnType.Longblob;
         case GenericDbColumnType.Int16:
         case GenericDbColumnType.UInt16:
             return "smallint";
         case GenericDbColumnType.Int32:
         case GenericDbColumnType.UInt32:
             return "integer";
         case GenericDbColumnType.Int64:
         case GenericDbColumnType.UInt64:
             return "bigint";
         case GenericDbColumnType.Object:
             return "blob";
         case GenericDbColumnType.SByte:
             return "tinyint";
         case GenericDbColumnType.Single:
             return "float";
         case GenericDbColumnType.StringLong:
             return "longtext";
         case GenericDbColumnType.Time:
             return "time";
         case GenericDbColumnType.VarNumeric:
             return "decimal";
         case GenericDbColumnType.Xml:
             return "mediumtext";
         default:
             throw new GeneralException("genericDbColumnType is unknown");
     }
 }
Пример #12
0
 /// <summary>
 /// Initializes a new instance of the TableColumn class.
 /// </summary>
 /// <param name="name">Name of the column</param>
 /// <param name="dataType">The column's data type</param>
 /// <param name="allowNull">A value indicating whether or not the column can be null</param>
 public TableColumn(string name, GenericDbColumnType dataType, bool allowNull)
 {
     this.name = name;
     this.dataType = dataType;
     this.allowNull = allowNull;
 }
Пример #13
0
 /// <summary>
 /// Initializes a new instance of the TableColumn class.
 /// </summary>
 /// <param name="name"></param>
 /// <param name="dataType"></param>
 /// <param name="precision"></param>
 /// <param name="scale"></param>
 /// <param name="allowNull"></param>
 /// <param name="foreignKeyTableName"></param>
 /// <param name="foreignKeyColumnName"></param>
 public TableColumn(string name, GenericDbColumnType dataType, int precision, int scale, bool allowNull, string foreignKeyTableName, string foreignKeyColumnName)
 {
     this.name = name;
     this.dataType = dataType;
     this.precision = precision;
     this.scale = scale;
     this.allowNull = allowNull;
     this.foreignKeyTableName = foreignKeyTableName;
     this.foreignKeyColumnName = foreignKeyColumnName;
 }
Пример #14
0
 /// <summary>
 /// Returns database sepecific column type
 /// </summary>
 /// <param name="dataType"></param>
 /// <returns></returns>
 public abstract string GetDbSpecificColumnType(GenericDbColumnType dataType);
Пример #15
0
        /// <summary>
        /// Gets the database-specific column data type.
        /// </summary>
        /// <param name="dataType">An extension of the System.Data.DbType that adds StringLong (Text, Memo) data type that Epi Info commonly uses.</param>
        /// <returns>Database-specific column data type.</returns>
        public override string GetDbSpecificColumnType(GenericDbColumnType dataType)
        {
            switch (dataType)
            {
                case GenericDbColumnType.AnsiString:
                case GenericDbColumnType.String:
                    return "nvarchar";

                case GenericDbColumnType.AnsiStringFixedLength:
                case GenericDbColumnType.StringFixedLength:
                    return "nchar";

                case GenericDbColumnType.Binary:
                    return "binary";

                case GenericDbColumnType.Boolean:
                    return "bit";

                case GenericDbColumnType.Byte:
                    return "tinyint";

                case GenericDbColumnType.Currency:
                    return "money";

                case GenericDbColumnType.Date:
                case GenericDbColumnType.DateTime:
                case GenericDbColumnType.Time:
                    return "datetime";

                case GenericDbColumnType.Decimal:
                    return "decimal";

                case GenericDbColumnType.Double:
                    return "float";

                case GenericDbColumnType.Guid:
                    return "uniqueidentifier";

                case GenericDbColumnType.Image:
                    return "image";

                case GenericDbColumnType.Int16:
                case GenericDbColumnType.UInt16:
                    return "smallint";

                case GenericDbColumnType.Int32:
                case GenericDbColumnType.UInt32:
                    return "int";

                case GenericDbColumnType.Int64:
                case GenericDbColumnType.UInt64:
                    return "bigint";

                case GenericDbColumnType.Object:
                    return "binary";

                case GenericDbColumnType.SByte:
                    return "tinyint";

                case GenericDbColumnType.Single:
                    return "real";

                case GenericDbColumnType.StringLong:
                    return "ntext";

                case GenericDbColumnType.VarNumeric:
                    return "decimal";

                case GenericDbColumnType.Xml:
                    return "xml";

                default:
                    throw new GeneralException("genericDbColumnType is unknown");
                    // return "nvarchar";
            }
        }
Пример #16
0
 /// <summary>
 /// Returns database sepecific column type
 /// </summary>
 /// <param name="dataType"></param>
 /// <returns></returns>
 public abstract string GetDbSpecificColumnType(GenericDbColumnType dataType);
Пример #17
0
        /// <summary>
        /// Gets the database-specific column data type.
        /// </summary>
        /// <param name="dataType">An extension of the System.Data.DbType that adds StringLong (Text, Memo) data type that Epi Info commonly uses.</param>
        /// <returns>Database-specific column data type.</returns>
        public override string GetDbSpecificColumnType(GenericDbColumnType dataType)
        {
            switch (dataType)
            {
                case GenericDbColumnType.AnsiString:
                case GenericDbColumnType.AnsiStringFixedLength:
                    return AccessColumnType.Text;

                case GenericDbColumnType.Binary:
                    return "binary";

                case GenericDbColumnType.Boolean:
                    return AccessColumnType.YesNo;

                case GenericDbColumnType.Byte:
                    return "byte";

                case GenericDbColumnType.Currency:
                    return AccessColumnType.Currency;

                case GenericDbColumnType.Date:
                case GenericDbColumnType.DateTime:
                case GenericDbColumnType.Time:
                    return "datetime";

                case GenericDbColumnType.Decimal:
                case GenericDbColumnType.Double:
                    return "double";

                case GenericDbColumnType.Guid:
                    return "text";

                case GenericDbColumnType.Int16:
                case GenericDbColumnType.UInt16:
                    return "SHORT";

                case GenericDbColumnType.Int32:
                case GenericDbColumnType.UInt32:
                    return "integer";

                case GenericDbColumnType.Int64:
                case GenericDbColumnType.UInt64:
                    return "LONG";

                case GenericDbColumnType.Object:
                case GenericDbColumnType.Image:
                    return "LONGBINARY";

                case GenericDbColumnType.SByte:
                    return "byte";

                case GenericDbColumnType.Single:
                    return "single";

                case GenericDbColumnType.String:
                case GenericDbColumnType.StringFixedLength:
                    return "text";

                case GenericDbColumnType.StringLong:
                case GenericDbColumnType.Xml:
                    return "MEMO";

                case GenericDbColumnType.VarNumeric:
                    return "double";

                default:
                    throw new GeneralException("genericDbColumnType is unknown");
            }
        }
Пример #18
0
        /// <summary>
        /// Gets the database-specific column data type.
        /// </summary>
        /// <param name="dataType">An extension of the System.Data.DbType that adds StringLong (Text, Memo) data type that Epi Info commonly uses.</param>
        /// <returns>Database-specific column data type.</returns>
        public override string GetDbSpecificColumnType(GenericDbColumnType dataType)
        {
            switch (dataType)
            {
            case GenericDbColumnType.AnsiString:
            case GenericDbColumnType.AnsiStringFixedLength:
                return(AccessColumnType.Text);

            case GenericDbColumnType.Binary:
                return("binary");

            case GenericDbColumnType.Boolean:
                return(AccessColumnType.YesNo);    // "yesno";

            case GenericDbColumnType.Byte:
                return("byte");

            case GenericDbColumnType.Currency:
                return(AccessColumnType.Currency);    // "CURRENCY";

            case GenericDbColumnType.Date:
            case GenericDbColumnType.DateTime:
            case GenericDbColumnType.Time:
                return("datetime");

            case GenericDbColumnType.Decimal:
            case GenericDbColumnType.Double:
                return("double");

            case GenericDbColumnType.Guid:
                return("GUID");

            case GenericDbColumnType.Int16:
            case GenericDbColumnType.UInt16:
                return("SHORT");

            case GenericDbColumnType.Int32:
            case GenericDbColumnType.UInt32:
                return("integer");

            case GenericDbColumnType.Int64:
            case GenericDbColumnType.UInt64:
                return("LONG");

            case GenericDbColumnType.Object:
            case GenericDbColumnType.Image:
                return("LONGBINARY");

            case GenericDbColumnType.SByte:
                return("byte");

            case GenericDbColumnType.Single:
                return("single");

            case GenericDbColumnType.String:
            case GenericDbColumnType.StringFixedLength:
                return("text");

            case GenericDbColumnType.StringLong:
            case GenericDbColumnType.Xml:
                return("MEMO");

            case GenericDbColumnType.VarNumeric:
                return("double");

            default:
                throw new GeneralException("genericDbColumnType is unknown");
                // return "text";
            }
        }
Пример #19
0
 /// <summary>
 /// Initializes a new instance of the TableColumn class.
 /// </summary>
 /// <param name="name"></param>
 /// <param name="dataType"></param>
 /// <param name="length"></param>
 /// <param name="allowNull"></param>
 /// <param name="foreignKeyTableName"></param>
 /// <param name="foreignKeyColumnName"></param>
 public TableColumn(string name, GenericDbColumnType dataType, int length, bool allowNull, string foreignKeyTableName, string foreignKeyColumnName)
 {
     this.name = name;
     this.dataType = dataType;
     this.length = length;
     this.allowNull = allowNull;
     this.foreignKeyTableName = foreignKeyTableName;
     this.foreignKeyColumnName = foreignKeyColumnName;
 }