VistaDB 6
VistaDB.Provider Namespace / VistaDBConnection Class / GetSchema Method / GetSchema(String) Method
Specifies the name of the schema to return.Specifies the name of the schema to return.


In This Topic
    GetSchema(String) Method
    In This Topic
    Returns schema information for the data source of this System.Data.Common.DbConnection using the specified string for the schema name. Returns schema information of the data source of this VistaDBConnection for the specified schema collectionName and applying no restriction values. (Example collections: "RESERVEDWORDS", "COLUMNS", "DATATYPES", "VIEWS", "FOREIGNKEYS")
    Syntax
    'Declaration
     
    
    Public Overloads Overrides NotOverridable Function GetSchema( _
       ByVal collectionName As System.String _
    ) As System.Data.DataTable
    'Usage
     
    
    Dim instance As VistaDBConnection
    Dim collectionName As System.String
    Dim value As System.Data.DataTable
     
    value = instance.GetSchema(collectionName)
    public override System.Data.DataTable GetSchema( 
       System.string collectionName
    )

    Parameters

    collectionName
    Specifies the name of the schema to return.Specifies the name of the schema to return.

    Return Value

    A System.Data.DataTable that contains schema information.A DataTable that contains schema information.
    Exceptions
    ExceptionDescription
    collectionName is specified as null.
    Remarks
    Examples schema that may be requested are: RESERVEDWORDS - list of words reserved for usage by the engine COLUMNS - List of columns DATATYPES - Types in usage by the current engine VIEWS - Views in the current database FOREIGNKEYS - Lists of foreign keys in database
    Example
    <<code lang="C#">> using (VistaDBConnection cn = new VistaDBConnection("Data Source=|DataDirectory|Database1.vdb6;")) { cn.Open(); DataTable schema = cn.GetSchema("FOREIGNKEYS"); foreach (DataRow dr in schema.Rows) { foreach (DataColumn dc in schema.Columns) { Console.WriteLine(dc.ColumnName + " = " + dr[dc].ToString()); } } } <</code>>
    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also