SaaS CMS has officially launched! Learn more now.

Class Column

Represents a Microsoft SQL Server column.

Inheritance
System.Object
Column
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Mediachase.BusinessFoundation.Data.Sql.Management
Assembly: Mediachase.BusinessFoundation.Data.dll
Version: 11.8.3
Syntax
public class Column

Constructors

Column()

Initializes a new instance of the Column class.

Declaration
public Column()

Column(Table, String, SqlDbType, Boolean, Int32, String, Boolean, Boolean, Int32, Int16)

Initializes a new instance of the Column class.

Declaration
public Column(Table ownerTable, string name, SqlDbType sqlDbType, bool isNullable, int lenght, string defaultValue, bool identity, bool primarykey, int precision, short scale)
Parameters
Type Name Description
Table ownerTable

The owner table.

System.String name

The name.

System.Data.SqlDbType sqlDbType

Type of the SQL db.

System.Boolean isNullable

if set to true [is nullable].

System.Int32 lenght

The lenght.

System.String defaultValue

The default value.

System.Boolean identity

if set to true [identity].

System.Boolean primarykey

if set to true [primarykey].

System.Int32 precision

The precision.

System.Int16 scale

The scale.

Column(String, SqlDbType, Boolean, Int32, String)

Initializes a new instance of the Column class.

Declaration
public Column(string name, SqlDbType sqlDbType, bool isNullable, int lenght, string defaultValue)
Parameters
Type Name Description
System.String name

The name.

System.Data.SqlDbType sqlDbType

Type of the SQL db.

System.Boolean isNullable

if set to true [is nullable].

System.Int32 lenght

The lenght.

System.String defaultValue

The default value.

Column(String, SqlDbType, Boolean, Int32, String, Boolean, Boolean)

Initializes a new instance of the Column class.

Declaration
public Column(string name, SqlDbType sqlDbType, bool isNullable, int lenght, string defaultValue, bool identity, bool primarykey)
Parameters
Type Name Description
System.String name

The name.

System.Data.SqlDbType sqlDbType

Type of the SQL db.

System.Boolean isNullable

if set to true [is nullable].

System.Int32 lenght

The lenght.

System.String defaultValue

The default value.

System.Boolean identity

if set to true [identity].

System.Boolean primarykey

if set to true [primarykey].

Column(String, SqlDbType, Boolean, Int32, String, Boolean, Boolean, Int32, Int16)

Initializes a new instance of the Column class.

Declaration
public Column(string name, SqlDbType sqlDbType, bool isNullable, int lenght, string defaultValue, bool identity, bool primarykey, int precision, short scale)
Parameters
Type Name Description
System.String name

The name.

System.Data.SqlDbType sqlDbType

Type of the SQL db.

System.Boolean isNullable

if set to true [is nullable].

System.Int32 lenght

The lenght.

System.String defaultValue

The default value.

System.Boolean identity

if set to true [identity].

System.Boolean primarykey

if set to true [primarykey].

System.Int32 precision

The precision.

System.Int16 scale

The scale.

Properties

DefaultValue

Gets the default value.

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

The default value.

Formula

Gets or sets the formula.

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

The formula.

Identity

Gets a value indicating whether this Column is identity.

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

true if identity; otherwise, false.

IdentityIncrement

Gets or sets the identity increment.

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

The identity increment.

IdentitySeed

Gets or sets the identity seed.

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

The identity seed.

IsNullable

Gets a value indicating whether this instance is nullable.

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

true if this instance is nullable; otherwise, false.

IsPrimaryKey

Gets a value that specifies whether the column is included in the definition of a primary key.

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

true if [in primary key]; otherwise, false.

Length

Gets the length.

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

The length.

Name

Gets the name.

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

The name.

OwnerTable

Gets the owner table.

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

The owner table.

Precision

Gets or sets the precision.

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

The precision.

Scale

Gets the scale.

Declaration
public short Scale { get; }
Property Value
Type Description
System.Int16

The scale.

SqlDbType

Gets the type of the SQL data.

Declaration
public SqlDbType SqlDbType { get; }
Property Value
Type Description
System.Data.SqlDbType

The type of the SQL data.

Methods

CreateDateTime(String, Boolean)

Creates the date time.

Declaration
public static Column CreateDateTime(string name, bool isNullable)
Parameters
Type Name Description
System.String name

The name.

System.Boolean isNullable

if set to true [is nullable].

Returns
Type Description
Column

CreateDateTime(String, Boolean, String)

Creates the date time.

Declaration
public static Column CreateDateTime(string name, bool isNullable, string defaultValue)
Parameters
Type Name Description
System.String name

The name.

System.Boolean isNullable

if set to true [is nullable].

System.String defaultValue

The default value.

Returns
Type Description
Column

CreateInt(String, Boolean)

Creates the int.

Declaration
public static Column CreateInt(string name, bool isNullable)
Parameters
Type Name Description
System.String name

The name.

System.Boolean isNullable

if set to true [is nullable].

Returns
Type Description
Column

CreateInt(String, Boolean, String)

Creates the int.

Declaration
public static Column CreateInt(string name, bool isNullable, string defaultValue)
Parameters
Type Name Description
System.String name

The name.

System.Boolean isNullable

if set to true [is nullable].

System.String defaultValue

The default value.

Returns
Type Description
Column

CreatePrimaryKey(String)

Creates the primary key.

Declaration
public static Column CreatePrimaryKey(string name)
Parameters
Type Name Description
System.String name

The name.

Returns
Type Description
Column

CreatePrimaryKey(String, Boolean)

Creates the primary key.

Declaration
public static Column CreatePrimaryKey(string name, bool identity)
Parameters
Type Name Description
System.String name

The name.

System.Boolean identity

if set to true [identity].

Returns
Type Description
Column

CreatePrimaryKey(String, SqlDbType, Boolean)

Creates the primary key.

Declaration
public static Column CreatePrimaryKey(string name, SqlDbType pkType, bool identity)
Parameters
Type Name Description
System.String name

The name.

System.Data.SqlDbType pkType

Type of the pk.

System.Boolean identity

if set to true [identity].

Returns
Type Description
Column

CreateUniqueIdentifier(String, Boolean)

Creates the unique identifier.

Declaration
public static Column CreateUniqueIdentifier(string name, bool isNullable)
Parameters
Type Name Description
System.String name

The name.

System.Boolean isNullable

if set to true [is nullable].

Returns
Type Description
Column

CreateUniqueIdentifier(String, Boolean, String)

Creates the unique identifier.

Declaration
public static Column CreateUniqueIdentifier(string name, bool isNullable, string defaultValue)
Parameters
Type Name Description
System.String name

The name.

System.Boolean isNullable

if set to true [is nullable].

System.String defaultValue

The default value.

Returns
Type Description
Column

GetDefaultValue()

Gets the default value.

Declaration
public string GetDefaultValue()
Returns
Type Description
System.String

GetSqlTypeString()

Gets the SQL type string.

Declaration
public string GetSqlTypeString()
Returns
Type Description
System.String

IsBinary(Column)

Determines whether the specified column is binary.

Declaration
public static bool IsBinary(Column column)
Parameters
Type Name Description
Column column

The column.

Returns
Type Description
System.Boolean

true if the specified column is binary; otherwise, false.

ToString()

Returns a System.String that represents the current System.Object.

Declaration
public override string ToString()
Returns
Type Description
System.String

A System.String that represents the current System.Object.

Overrides
System.Object.ToString()