Ejemplo n.º 1
0
        /// <summary>
        /// creates a new type definition from the data in the row specified.
        /// </summary>
        /// <param name="row">The row.</param>
        /// <param name="columnNameTypeName">Name of the column name type.</param>
        /// <param name="columnNameLength">Length of the column name.</param>
        /// <returns>a filled DBTypeDefinition instance</returns>
        private DBTypeDefinition CreateTypeDefinition(DataRow row, string columnNameTypeName, string columnNameLength)
        {
            DBTypeDefinition toReturn         = new DBTypeDefinition();
            string           datatypeAsString = row.Value <string>(columnNameTypeName);
            int length    = row.Value <int>(columnNameLength);
            int precision = row.Value <int?>("precision") ?? length;
            int dbType    = SybaseAsaDBDriver.ConvertStringToDBType(datatypeAsString, length);

            switch ((AsaDbTypes)dbType)
            {
            case AsaDbTypes.Image:
            case AsaDbTypes.LongBinary:
            case AsaDbTypes.LongNVarChar:
            case AsaDbTypes.LongVarChar:
                length = 0;                             // unlimited.
                break;
            }
            int scale = row.Value <int?>("scale") ?? 0;

            switch ((AsaDbTypes)dbType)
            {
            case AsaDbTypes.Image:
            case AsaDbTypes.LongBinary:
            case AsaDbTypes.LongNVarChar:
            case AsaDbTypes.LongVarChar:
                length = 0;                             // unlimited.
                break;
            }
            toReturn.SetDBType(dbType, this.DriverToUse, length, precision, scale);
            return(toReturn);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// CTor
 /// </summary>
 /// <param name="driverToUse">The driver to use for the connection</param>
 public SybaseAsaConnectionData(SybaseAsaDBDriver driverToUse)
     : base(driverToUse)
 {
 }
 /// <summary>
 /// CTor
 /// </summary>
 public SybaseAsaCatalogRetriever(SybaseAsaDBDriver driverToUse) : base(driverToUse)
 {
 }