コード例 #1
0
        /// <summary>
        /// Enumerate columns info
        /// </summary>
        /// <param name="tableName">Table name</param>
        /// <returns>Columns info list</returns>
        public VDBColumnInfo[] EnumColumns(string tableName)
        {
            int position;
            int columnsCount;

            VDBColumnInfo[] columns;

            if (!FindTable(tableName))
            {
                return(null);
            }

            position = this.position;

            try
            {
                FindColumnSection();
                GetInteger();
                columnsCount = GetInteger();
                columns      = new VDBColumnInfo[columnsCount];

                for (int i = 0; i < columnsCount; i++)
                {
                    columns[i].Name     = GetString();
                    columns[i].Caption  = GetString();
                    columns[i].DataType = VistaDBAPI.NetDataType(GetChar().ToString());
                    columns[i].Width    = GetInteger();
                    columns[i].Decimals = GetInteger();

                    columns[i].DefValue          = GetString();
                    columns[i].Identity          = GetBool();
                    columns[i].IncStep           = GetDouble();
                    columns[i].UseDefValInUpdate = GetBool();

                    columns[i].AllowNull   = GetBool();
                    columns[i].Description = GetString();
                    columns[i].ReadOnly    = GetBool();
                    columns[i].Compressed  = GetBool();
                    columns[i].Encrypted   = GetBool();
                    columns[i].Hidden      = GetBool();
                    columns[i].PrimaryKey  = GetBool();
                    columns[i].Indexed     = GetBool();
                    columns[i].Unicode     = GetBool();

                    columns[i].FTS = GetBool();
                }
            }
            finally
            {
                this.position = position;
            }

            return(columns);
        }
コード例 #2
0
		/// <summary>
		/// Enumerate columns info
		/// </summary>
		/// <param name="tableName">Table name</param>
		/// <returns>Columns info list</returns>
		public VDBColumnInfo[] EnumColumns(string tableName)
		{
			int position;
			int columnsCount;
			VDBColumnInfo[] columns;

			if(!FindTable(tableName))
				return null;

			position = this.position;

			try
			{
				FindColumnSection();
				GetInteger();
				columnsCount = GetInteger();
				columns      = new VDBColumnInfo[columnsCount];
    
				for(int i = 0; i< columnsCount; i++)
				{
					columns[i].Name               = GetString();
					columns[i].Caption            = GetString();
					columns[i].DataType           = VistaDBAPI.NetDataType(GetChar().ToString());
					columns[i].Width              = GetInteger();
					columns[i].Decimals           = GetInteger();

					columns[i].DefValue           = GetString();
					columns[i].Identity           = GetBool();
					columns[i].IncStep            = GetDouble();
					columns[i].UseDefValInUpdate  = GetBool();

					columns[i].AllowNull          = GetBool();
					columns[i].Description        = GetString();
					columns[i].ReadOnly           = GetBool();
					columns[i].Compressed         = GetBool();
					columns[i].Encrypted          = GetBool();
					columns[i].Hidden             = GetBool();
					columns[i].PrimaryKey         = GetBool();
					columns[i].Indexed            = GetBool();
					columns[i].Unicode            = GetBool();

					columns[i].FTS                = GetBool();
				}
			}
			finally
			{
				this.position = position;
			}

			return columns;
		}