BigQueryConnectionParameters Class
Contains parameters used to establish a connection with a Google BigQuery dataset.
Namespace: DevExpress.DataAccess.ConnectionParameters
Assembly: DevExpress.DataAccess.v24.2.dll
Declaration
public class BigQueryConnectionParameters :
DataConnectionParametersBase,
IConnectionPageBigQuery
Remarks
Install the ODBC driver to allow your application to establish a connection with Google BigQuery datasets.
To connect your application with a Google BigQuery dataset, create a BigQueryConnectionParameters class instance and specify the following parameters:
- Project ID
- Gets or sets the ID of the project that contains the required data.
- Dataset ID
- Gets or sets the ID of the dataset that contains required tables.
- Authorization type
- Gets or sets the authorization type used to establish a connection to data.
For the ODBC driver, only the PrivateKeyFile authorization type is available. For this authorization type, you should specify the following options:
- PrivateKeyFileName
- Gets or sets the path to the P12 private key file.
- ServiceAccountEmail
- Gets or sets the service account’s email address.
Note that besides the PrivateKeyFile authorization, you can also use the OAuth authorization, which is available only when the BigQueryProvider driver is installed (no longer maintained and supported).
For the OAuth authorization, you should specify client ID, client secret, and refresh token options.
Once you configured all required connection parameters, create a SqlDataSource object and assign these parameters (the BigQueryConnectionParameters class instance) to the data source’s ConnectionParameters property. Then, call the data source’s Fill method to load data from the BigQuery dataset.
Example
using DevExpress.DataAccess.ConnectionParameters;
using DevExpress.DataAccess.Sql;
//...
var bigQueryConnectionParams = new BigQueryConnectionParameters() {
ProjectID = "projectID",
DataSetID = "datasetID",
AuthorizationType = BigQueryAuthorizationType.PrivateKeyFile,
PrivateKeyFileName = "filename",
ServiceAccountEmail = "email"
};
var sqlDatasource = new SqlDataSource();
sqlDatasource.ConnectionParameters = bigQueryConnectionParams;
sqlDatasource.Fill();
// ...