The QueryBuilder component has SyntaxProvider and MetadataProvider properties. They must be set to the instances of appropriate objects in order to work properly. This article describes the purpose of these objects.

Syntax Providers define the rules of SQL query parsing and generation for a specific database server. It also determines the queries to retrieve metadata from a specific database server using system tables. The component cannot work without a syntax provider. There are few generic syntax providers for different ANSI SQL standards that do not relate to any specific database server, thus they might be used with any database server that's compatible with the appropriate standard.

The AutoSyntaxProvider may be used if you don't know which database server the user will be connected to. This syntax provider will send a series of server specific queries to detect the underlying database server. After successful detection it will act as appropriate database server syntax provider; otherwise it will act as Universal syntax provider.

The GenericSyntaxProvider is recommended to work with those database servers only for which Active Query Builder does not provide a special syntax provider. The Generic syntax provider supports only ANSI SQL/92 syntax and additionaly implements the way to retrieve metadata from all the supported database servers. It was originally made for the Free Edition of Active Query Builder which lacks support of specifiŅ database server SQL syntax extensions.

Metadata Providers are intended to link Active Query Builder to specific data access components. Their main task is to execute the metadata retrieval queries sent by the component. The Metadata provider does not create necessary database connectivity objects, but an instance of appropriate database connection object should be assigned to the Connection property of the a metadata provider.

The OLE DB, ODBC and some other metadata providers also can retrieve metadata information using the GetSchema or other methods of appropriate data access components. If Active Query Builder fails to load metadata using the server-specific queries, it tries to load this information by means of metadata provider.

Universal metadata provider is generally suitable for all types of database connections as it accepts System.Data.Common.DbConnection object that is a common ansector of all .NET DB connections, but this provider not always the best choice as it lacks support of specific DB connection ways to retrieve metadata. I recommend you to use it only if there's no special metadata provider for your DB connection.

The EventMetadataProvider provides the way to get connected to DB connections that aren't inherited from DbConnection object. It might be suitable for a three-tier connection or a web service.

The component can work without a metadata provider. In this case it will not be able to execute the metadata retrieval queries, thus this information must be loaded in some other ways and the QueryBuilder.OfflineMode property should be set to True to avoid run-time exceptions.

Below is the list of supported DbConnection namespaces and appropriate metadata providers for Active Query Builder for .NET.

NamespaceMetadata Provider
System.Data.CommonUniversalMetadataProvider
System.Data.OleDbOLEDBMetadataProvider
System.Data.OdbcODBCMetadataProvider
System.Data.SqlClientMSSQLMetadataProvider
System.Data.SqlServerCeMSSQLCEMetadataProvider
System.Data.OracleClient (obsolete)OracleMetadataProvider
Oracle.ManagedDataAccessOracleNativeMetadataProvider
MySql.DataMySQLMetadataProvider
NpgsqlPostgreSQLMetadataProvider
FirebirdSql.Data.FirebirdClientFirebirdMetadataProvider
iAnywhere.Data.SQLAnywhereSybaseMetadataProvider
IBM.Data.InformixInformixMetadataProvider
IBM.Data.DB2DB2MetadataProvider
Advantage.Data.ProviderAdvantageMetadataProvider
VistaDB.5.NET40VistaDB5MetadataProvider
-EventMetadataProvider


Is this article helpful for you?