VistaDB 5






GetSchema() Method
Returns schema information for the data source of this VistaDBConnection. See the MSDN Topic "Understanding the Common Schema Collections" for in depth information about Schema collections. Class VistaDBConnection
Syntax
'Declaration
 
Public Overloads Overrides NotOverridable Function GetSchema() As System.Data.DataTable
'Usage
 
Dim instance As VistaDBConnection
Dim value As System.Data.DataTable
 
value = instance.GetSchema()
public override System.Data.DataTable GetSchema()
public function GetSchema(): System.Data.DataTable; override; 
public override function GetSchema() : System.Data.DataTable;
public: System.Data.DataTable* GetSchema(); override 
public:
System.Data.DataTable^ GetSchema(); override 

Return Value

A DataTable that contains schema collection information
Example
<<code lang="C#">> using( VistaDB.Provider.VistaDBConnection connection = new VistaDB.Provider.VistaDBConnection("Data Source=" + dbName) ) { connection.Open(); // Get the list of Schema collections and their restrictions from the connection DataTable schema = connection.GetSchema(); Assert.IsNotEmpty(schema.Rows); foreach (DataRow myField in schema.Rows) { foreach (DataColumn myProperty in schema.Columns) { Console.WriteLine(myProperty.ColumnName + " = " + myField[myProperty].ToString()); } } } <</code>> The above will output a console list like this listed below: CollectionName = ForeignKeys NumberOfRestrictions = 4 NumberOfIdentifierParts = 3 CollectionName = ForeignKeyColumns NumberOfRestrictions = 5 NumberOfIdentifierParts = 4 CollectionName = ReservedWords NumberOfRestrictions = 0 NumberOfIdentifierParts = 0 CollectionName = Views NumberOfRestrictions = 3 NumberOfIdentifierParts = 3 CollectionName = ViewColumns NumberOfRestrictions = 4 NumberOfIdentifierParts = 4 CollectionName = Restrictions NumberOfRestrictions = 0 NumberOfIdentifierParts = 0
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