TypeInfo.Name Property

Gets or sets the name for the data type.

Namespace:  Microsoft.Web.Management.DatabaseManager
Assembly:  Microsoft.Web.Management.DatabaseManager (in Microsoft.Web.Management.DatabaseManager.dll)

Syntax

'Declaration
Public Property Name As String
'Usage
Dim instance As TypeInfo
Dim value As String

value = instance.Name

instance.Name = value
public string Name { get; set; }
public:
property String^ Name {
    String^ get ();
    void set (String^ value);
}
function get Name () : String
function set Name (value : String)

Property Value

Type: System.String
The name for the data type.

Remarks

The name of the data type will be displayed in the Database Manager in IIS Manager.

Examples

The following code sample illustrates an example GetServerTypes method that returns a list of database types for an OLEDB provider.


    Public Overrides Function GetServerTypes( _
            ByVal connectionString As String) _
            As System.Collections.Generic.ICollection( _
            Of Microsoft.Web.Management.DatabaseManager.TypeInfo)

        Dim types As List(Of TypeInfo) = New List(Of TypeInfo)
        Dim info As TypeInfo

        ' Add a Binary type.
        info = New TypeInfo
        info.AllowIdentity = False
        info.AllowLength = True
        info.AllowNulls = True
        info.IsBinary = True
        info.IsVariableLength = False
        info.Name = "Binary"
        types.Add(info)

        ' Add a Bit type.
        info = New TypeInfo
        info.AllowIdentity = False
        info.AllowLength = False
        info.AllowNulls = True
        info.IsBinary = False
        info.IsVariableLength = False
        info.Name = "Bit"
        types.Add(info)

        ' Add a Byte type.
        info = New TypeInfo
        info.AllowIdentity = False
        info.AllowLength = False
        info.AllowNulls = True
        info.IsBinary = False
        info.IsVariableLength = False
        info.Name = "Byte"
        types.Add(info)

        ' Add a Currency type.
        info = New TypeInfo
        info.AllowIdentity = False
        info.AllowLength = False
        info.AllowNulls = True
        info.HasPrecision = True
        info.MaximumPrecision = 28
        info.DefaultPrecision = 18
        info.IsBinary = False
        info.IsVariableLength = False
        info.Name = "Currency"
        types.Add(info)

        ' Add a DateTime type.
        info = New TypeInfo
        info.AllowIdentity = False
        info.AllowLength = False
        info.AllowNulls = True
        info.IsBinary = False
        info.IsVariableLength = False
        info.Name = "DateTime"
        types.Add(info)

        ' Add a Decimal type.
        info = New TypeInfo
        info.AllowIdentity = False
        info.AllowLength = False
        info.AllowNulls = True
        info.HasPrecision = True
        info.MaximumPrecision = 28
        info.DefaultPrecision = 18
        info.IsBinary = False
        info.IsVariableLength = False
        info.Name = "Decimal"
        types.Add(info)

        ' Add a Float type.
        info = New TypeInfo
        info.AllowIdentity = False
        info.AllowLength = False
        info.AllowNulls = True
        info.IsBinary = False
        info.IsVariableLength = False
        info.Name = "Float"
        types.Add(info)
        ' Add an Integer type.
        info = New TypeInfo
        info.AllowIdentity = False
        info.AllowLength = False
        info.AllowNulls = True
        info.IsBinary = False
        info.IsVariableLength = False
        info.Name = "Integer"
        types.Add(info)

        ' Add a Real type.
        info = New TypeInfo
        info.AllowIdentity = False
        info.AllowLength = False
        info.AllowNulls = True
        info.IsBinary = False
        info.IsVariableLength = False
        info.Name = "Real"
        types.Add(info)

        ' Add a SmallInt type.
        info = New TypeInfo
        info.AllowIdentity = False
        info.AllowLength = False
        info.AllowNulls = True
        info.IsBinary = False
        info.IsVariableLength = False
        info.Name = "SmallInt"
        types.Add(info)
        ' Add a Text type.
        info = New TypeInfo
        info.AllowIdentity = False
        info.AllowLength = True
        info.AllowNulls = True
        info.IsBinary = False
        info.IsVariableLength = True
        info.Name = "Text"
        types.Add(info)

        ' Add a UNIQUEIDENTIFIER type.
        info = New TypeInfo
        info.AllowIdentity = True
        info.AllowLength = False
        info.AllowNulls = False
        info.IsBinary = False
        info.IsVariableLength = False
        info.Name = "UniqueIdentifier"
        types.Add(info)

        Return types

    End Function


        public override ICollection<TypeInfo> GetServerTypes(
            string connectionString )
        {
            List<TypeInfo> types = new List<TypeInfo>();
            TypeInfo info;

            // Add a Binary type.
            info = new TypeInfo();
            info.AllowIdentity = false;
            info.AllowLength = true;
            info.AllowNulls = true;
            info.IsBinary = true;
            info.IsVariableLength = false;
            info.Name = "Binary";
            types.Add(info);

            // Add a Bit type.
            info = new TypeInfo();
            info.AllowIdentity = false;
            info.AllowLength = false;
            info.AllowNulls = true;
            info.IsBinary = false;
            info.IsVariableLength = false;
            info.Name = "Bit";
            types.Add(info);

            // Add a Byte type.
            info = new TypeInfo();
            info.AllowIdentity = false;
            info.AllowLength = false;
            info.AllowNulls = true;
            info.IsBinary = false;
            info.IsVariableLength = false;
            info.Name = "Byte";
            types.Add(info);

            // Add a Currency type.
            info = new TypeInfo();
            info.AllowIdentity = false;
            info.AllowLength = false;
            info.AllowNulls = true;
            info.HasPrecision = true;
            info.MaximumPrecision = 28;
            info.DefaultPrecision = 18;
            info.IsBinary = false;
            info.IsVariableLength = false;
            info.Name = "Currency";
            types.Add(info);

            // Add a DateTime type.
            info = new TypeInfo();
            info.AllowIdentity = false;
            info.AllowLength = false;
            info.AllowNulls = true;
            info.IsBinary = false;
            info.IsVariableLength = false;
            info.Name = "DateTime";
            types.Add(info);

            // Add a Decimal type.
            info = new TypeInfo();
            info.AllowIdentity = false;
            info.AllowLength = false;
            info.AllowNulls = true;
            info.HasPrecision = true;
            info.MaximumPrecision = 28;
            info.DefaultPrecision = 18;
            info.IsBinary = false;
            info.IsVariableLength = false;
            info.Name = "Decimal";
            types.Add(info);

            // Add a Float type.
            info = new TypeInfo();
            info.AllowIdentity = false;
            info.AllowLength = false;
            info.AllowNulls = true;
            info.IsBinary = false;
            info.IsVariableLength = false;
            info.Name = "Float";
            types.Add(info);

            // Add an Integer type.
            info = new TypeInfo();
            info.AllowIdentity = false;
            info.AllowLength = false;
            info.AllowNulls = true;
            info.IsBinary = false;
            info.IsVariableLength = false;
            info.Name = "Integer";
            types.Add(info);

            // Add a Real type.
            info = new TypeInfo();
            info.AllowIdentity = false;
            info.AllowLength = false;
            info.AllowNulls = true;
            info.IsBinary = false;
            info.IsVariableLength = false;
            info.Name = "Real";
            types.Add(info);

            // Add a SmallInt type.
            info = new TypeInfo();
            info.AllowIdentity = false;
            info.AllowLength = false;
            info.AllowNulls = true;
            info.IsBinary = false;
            info.IsVariableLength = false;
            info.Name = "SmallInt";
            types.Add(info);

            // Add a Text type.
            info = new TypeInfo();
            info.AllowIdentity = false;
            info.AllowLength = true;
            info.AllowNulls = true;
            info.IsBinary = false;
            info.IsVariableLength = true;
            info.Name = "Text";
            types.Add(info);

            // Add a UNIQUEIDENTIFIER type.
            info = new TypeInfo();
            info.AllowIdentity = true;
            info.AllowLength = false;
            info.AllowNulls = false;
            info.IsBinary = false;
            info.IsVariableLength = false;
            info.Name = "UniqueIdentifier";
            types.Add(info);

            return types;
        }

Permissions

See Also

Reference

TypeInfo Class

Microsoft.Web.Management.DatabaseManager Namespace