Getting Started With dotConnect for Google BigQuery

Below are some resources to help you maximize your experience with dotConnect for Google BigQuery.

dotConnect for Google BigQuery is an ADO.NET data provider with ORM support that enables .NET applications to connect to Google BigQuery over HTTPS and work with cloud-based analytical data.

  • EF Core, Dapper, NHibernate ORM support
  • GoogleSQL and Legacy SQL support
  • Broad compatibility with various .NET platforms and versions
  • Full compliance with ADO.NET
  • Integration with Visual Studio

Code examples

using Devart.Data.BigQuery;

class Program
{
  static void Main()
  {
    using BigQueryConnection conn = new(
      "Authentication Type=ServiceAccount;" +
      "Project Id=your_project_id;" +
      "ServiceAccount Json=your_service_account_json;" +
      "License Key=your_license_key");
    conn.Open();
  }
}
PM> Install-Package Devart.Data.BigQuery
using Devart.Data.BigQuery;

class Program
{
  static void Main()
  {
    using BigQueryConnection conn = new(
      "Authentication Type=UserAccount;" +
      "Project Id=your_project_id;" +
      "Client Id=your_client_id;" +
      "Client Secret=your_client_secret;" +
      "Refresh Token=your_refresh_token;" +
      "License Key=your_license_key");
    conn.Open();
  }
}
PM> Install-Package Devart.Data.BigQuery
using Devart.Data.BigQuery;

class Program
{
  static void Main()
  {
    using BigQueryConnection conn = new(
      "Authentication Type=UserAccountInteractive;" +
      "Project Id=your_project_id;" +
      "License Key=your_license_key");
    conn.Open();
  }
}
PM> Install-Package Devart.Data.BigQuery
using Devart.Data.BigQuery;
using System;

class Program
{
  static void Main()
  {
    using BigQueryConnection conn = new(
      "Authentication Type=ServiceAccount;" +
      "Project Id=your_project_id;" +
      "DataSet Id=your_data_set_id;" +
      "ServiceAccount Json=your_service_account_json;" +
      "License Key=your_license_key");
    conn.Open();

    using BigQueryCommand cmd = new("SELECT id, name FROM orders", conn);
    using BigQueryDataReader reader = cmd.ExecuteReader();
    while (reader.Read())
    {
      Console.WriteLine(reader["name"]);
    }
  }
}
PM> Install-Package Devart.Data.BigQuery
using Devart.Data.BigQuery;
using System;

class Program
{
  static void Main()
  {
    using BigQueryConnection conn = new(
      "Authentication Type=ServiceAccount;" +
      "Project Id=your_project_id;" +
      "DataSet Id=your_data_set_id;" +
      "ServiceAccount Json=your_service_account_json;" +
      "License Key=your_license_key");
    conn.Open();

    using BigQueryCommand cmd = new("SELECT id, name FROM orders WHERE id = @id", conn);
    cmd.Parameters.Add(new BigQueryParameter { ParameterName = "id", Value = 1 });
    using BigQueryDataReader reader = cmd.ExecuteReader();
    while (reader.Read())
    {
      Console.WriteLine(reader["name"]);
    }
  }
}
PM> Install-Package Devart.Data.BigQuery
using Devart.Data.BigQuery;
using System.Data;

class Program
{
  static void Main()
  {
    using BigQueryConnection conn = new(
      "Authentication Type=ServiceAccount;" +
      "Project Id=your_project_id;" +
      "DataSet Id=your_data_set_id;" +
      "ServiceAccount Json=your_service_account_json;" +
      "License Key=your_license_key");
    conn.Open();

    using BigQueryDataAdapter adapter = new("SELECT id, name FROM orders", conn);
    DataTable table = new();
    adapter.Fill(table);
  }
}
PM> Install-Package Devart.Data.BigQuery
using Devart.Data.BigQuery;
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;

[Table("orders")]
class Order
{
  public long Id { get; set; }
  public string Name { get; set; }
}

class AppDbContext : DbContext
{
  public DbSet<Order> Orders { get; set; }

  protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
  {
    optionsBuilder.UseBigQuery(
      "Authentication Type=ServiceAccount;" +
      "Project Id=your_project_id;" +
      "DataSet Id=your_data_set_id;" +
      "ServiceAccount Json=your_service_account_json;" +
      "License Key=your_license_key");
  }
}

class Program
{
  static void Main()
  {
    using AppDbContext db = new();
    var orders = db.Orders.Where(o => o.Id > 0).ToList();
  }
}
PM> Install-Package Devart.Data.BigQuery.EFCore
using Devart.Data.BigQuery;

class Program
{
  static void Main()
  {
    using BigQueryConnection conn = new(
      "Authentication Type=ServiceAccount;" +
      "Project Id=your_project_id;" +
      "DataSet Id=your_data_set_id;" +
      "ServiceAccount Json=your_service_account_json;" +
      "Default Cloud Storage Bucket=your_bucket_name;" +
      "License Key=your_license_key");
    conn.Open();

    BigQueryLoader loader = new("orders", conn);
    loader.CreateColumns();
    loader.Open();
    loader.SetValue(0, 1);
    loader.SetValue(1, "Order 1");
    loader.NextRow();
    loader.Close();
  }
}
PM> Install-Package Devart.Data.BigQuery

Documentation

Licensing
A detailed technical reference on embedding license information - a required resource for applications built with dotConnect for Google BigQuery.
Deployment
A guide to deploying applications built with dotConnect for Google BigQuery, including the required runtime assemblies.
DataAdapter features
A guide to using the BigQueryDataAdapter class for interacting with Google BigQuery data in a disconnected architecture.
BigQueryLoader
A reference for the BigQueryLoader class that loads data into Google BigQuery tables in bulk through Google Cloud Storage.

dotConnect Universal

Get universal access to data from a variety of sources, including SQL Server, Oracle, PostgreSQL, MySQL, SQLite, DB2, InterBase, Microsoft Access, and Firebird. Other servers can be accessed through their ADO.NET, OLE DB and ODBC providers.

FAQ

What is the trial period for dotConnect for Google BigQuery?
dotConnect for Google BigQuery offers a fully functional 30-day trial. During this period, you can use and evaluate all features without limitations. After the trial ends, you can purchase a license to keep using the product.
Can I use dotConnect for Google BigQuery in Visual Studio Code, JetBrains Rider, or other IDEs?

Yes. Add the Devart.Data.BigQuery NuGet package (and Devart.Data.BigQuery.EFCore for Entity Framework Core) to your project and specify the license key.

Design-time features, such as Server Explorer integration and Toolbox components, are available only in Visual Studio.

Where should I apply my License Key?

Specify the key in the License Key connection string parameter. Alternatively, call the static BigQueryConnection.LoadLicenseKey method before opening the first connection.

Do end users of my application need a Devart license, or do I have to pay additional fees for deploying my software?

End users of your application do not need a Devart license. Any dotConnect license allows deploying your application to an unlimited number of desktops, workstations, and non-production servers within your company. To deploy the application to a production server, you need a Server license for each server. To distribute the application to third parties, you need the OEM license.

According to the EULA, you're allowed to redistribute the following runtime assemblies with your application:

  • Devart.Data.BigQuery.dll
  • Devart.Data.SqlShim.dll
  • Devart.Data.dll
  • Devart.Data.BigQuery.EFCore.dll (for Entity Framework Core applications)

If you reference the provider via NuGet packages, these assemblies are copied to the output folder automatically.

There's no need for a full installation on the target machine, you can also use the "Minimal installation" option provided by the setup.

No other components of dotConnect may be distributed.

How can I update dotConnect for Google BigQuery to a new version?

Close all running IDEs and help collections, then run the installation package of the newer version. You will be prompted to uninstall the previous version. Agree, and then proceed to installing the newer build.

If you use NuGet packages, update the Devart.Data.BigQuery package (and Devart.Data.BigQuery.EFCore, if used) to the new version.

How can I completely remove all previous versions of a product?
  1. Go to Settings > Apps > Installed apps and uninstall:
    • All dotConnect providers
    • Entity Developer
    • LinqConnect
  2. Manually delete any leftover files from the following locations (if they exist):

    GAC folders:

    • C:\Windows\assembly\GAC_MSIL
    • C:\Windows\Microsoft.NET\assembly\GAC_MSIL

    Program files and extensions:

    • C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\Extensions\Devart
    • C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\Extensions\Devart
    • C:\Program Files (x86)\Devart
    • C:\Program Files\Devart
    • C:\Program Files (x86)\Common Files\Devart
    • C:\Program Files\Common Files\Devart

    Program data folders:

    • C:\ProgramData\Devart\dotConnect
    • C:\ProgramData\Devart\Entity Developer

Removing these ensures a clean system and prevents conflicts during future installations.

dotConnect for Google BigQuery

Get an ORM-enabled data provider for Google BigQuery and build .NET applications that work with BigQuery data quickly and easily.

Try the 30-day trial of the full product. No limits. No card required. Start free trial