| Visual Basic (Declaration) | |
|---|---|
Public Overloads Shared Function AutoGenerate( _ ByVal name As System.String, _ ByVal connection As System.Data.IDbConnection, _ ByVal queryString As System.String _ ) As SchemaBuilder | |
| C# | |
|---|---|
public static SchemaBuilder AutoGenerate( System.string name, System.Data.IDbConnection connection, System.string queryString ) | |
Parameters
- name
- The name of the schema definition.
- connection
- The connection to the database.
- queryString
- The query string.
Return Value
The generated instance of the SchemaBuilder for further schema modifications.| Exception | Description |
|---|---|
| System.ArgumentNullException | The name, connection or queryString is null reference (Nothing
in Visual Basic). |
This method generates schema definition which based on the result of the execution of query from the queryString.
Columns of following list of types (and corresponding DB-types) will be represented as a measures: System.SByte, System.Byte, System.Int16, System.UInt16, System.Int32, System.UInt32, System.Int64, System.UInt64, System.Decimal, System.Double, System.Single.
Columns of following list of types (and corresponding DB-types) will be represented as a attributes: System.String, System.Boolean.
Columns of following list of types (and corresponding DB-types) will be represented as a hierarchies: System.DateTime.
| C# | Copy Code |
|---|---|
OleDbConnection connection = new OleDbConnection(ConnectionString); string query = "SELECT * FROM SalesHistory"; string name = "Sales History"; SchemaBuilder sb = SchemaBuilder.AutoGenerate(name, connection, query); | |
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