Show / Hide Table of Contents

    Class ColumnSchema

    Schema of a database table column.

    Inheritance
    System.Object
    ColumnSchema
    SqlServerColumnSchema
    Namespace: Kros.Data.Schema
    Assembly: Kros.Utils.dll
    Syntax
    public abstract class ColumnSchema

    Constructors

    ColumnSchema(String, Boolean, Object, Int32)

    Creates an instance of column schema with name and specified parameters.

    Declaration
    public ColumnSchema(string name, bool allowNull, object defaultValue, int size)
    Parameters
    Type Name Description
    System.String name

    Column's name

    System.Boolean allowNull

    Specifies if column accepts NULL value.

    System.Object defaultValue

    Column's default value.

    System.Int32 size

    Maximum length of text columns. If value is 0, maximum length is unlimited.

    Exceptions
    Type Condition
    System.ArgumentNullException

    Value of name is null.

    System.ArgumentException

    Value of name is empty string, or string containing only whitespace characters.

    Fields

    DefaultAllowNull

    Default value for column's AllowNull. The value is false.

    Declaration
    public const bool DefaultAllowNull = true
    Field Value
    Type Description
    System.Boolean

    DefaultDefaultValue

    Value for the column's DefaultValue, if none is defined. The value is System.DBNull.

    Declaration
    public static readonly object DefaultDefaultValue
    Field Value
    Type Description
    System.Object

    DefaultSize

    Default value for column's Size. The value is 0.

    Declaration
    public const int DefaultSize = 0
    Field Value
    Type Description
    System.Int32

    Properties

    AllowNull

    Specifies if NULL value is allowed.

    Declaration
    public bool AllowNull { get; set; }
    Property Value
    Type Description
    System.Boolean

    DefaultValue

    Column's default value.

    Declaration
    public object DefaultValue { get; set; }
    Property Value
    Type Description
    System.Object

    FullName

    Full name of the column, together with the table name (if column belongs to table).

    Declaration
    public string FullName { get; }
    Property Value
    Type Description
    System.String

    Name

    Column name.

    Declaration
    public string Name { get; }
    Property Value
    Type Description
    System.String

    Size

    Maximum length of text columns. If value is 0, maximum length is unlimited.

    Declaration
    public int Size { get; set; }
    Property Value
    Type Description
    System.Int32

    Table

    The table to which the column belongs. The table is set automatically when the column is added to table's Columns collection.

    Declaration
    public TableSchema Table { get; }
    Property Value
    Type Description
    TableSchema

    Methods

    SetParameterDbType(IDataParameter)

    Sets data type to command parameter param.

    Declaration
    public abstract void SetParameterDbType(IDataParameter param)
    Parameters
    Type Name Description
    System.Data.IDataParameter param

    Parameter for System.Data.IDbCommand commands.

    ToStringDefaultValue()

    Returns value for DefaultValue for use in ToString().

    Declaration
    protected object ToStringDefaultValue()
    Returns
    Type Description
    System.Object

    String "NULL" if value of DefaultValue is System.DBNull or null. Otherwise returns DefaultValue.

    Back to top KROS a.s.