Getting Started With dotConnect for BigCommerce

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

dotConnect for BigCommerce is a high-performance ADO.NET data provider with ORM support, offering fast and encrypted access to BigCommerce data for application development.

  • EF Core, Dapper, NHibernate ORM support
  • Local SQL engine with support for SQL-92
  • Compatibility with various .NET platforms and versions
  • Full compliance with ADO.NET
  • Integration with Visual Studio

Code examples

using Devart.Data.Bigcommerce;

namespace BigcommerceConsoleApp
{
    class Program
    {
        static void Main(string[] args)
        {

            string connectionString = $"API Version=v3;Authentication Type=OAuth;Store Id=*****;Client Id=*****;Access Token=*****;License Key=*****";

            try
            {
                using (BigcommerceConnection connection = new BigcommerceConnection(connectionString))
                {
                    connection.Open();
                    Console.WriteLine("Connection successful.");
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("An error occurred: " + ex.Message);
            }
        }

    }
}
PM> Install-Package Devart.Data.Bigcommerce
using System.Data;
using Devart.Data.Bigcommerce;

namespace BigcommerceConsoleApp
{
    class Program
    {
        static void Main(string[] args)
        {
            string connectionString = $"API Version=v3;Authentication Type=OAuth;Store Id=*****;Client Id=*****;Access Token=*****;License Key=*****";

            try
            {
                using (BigcommerceConnection connection = new BigcommerceConnection(connectionString))
                {
                    connection.Open();
                    Console.WriteLine("Connection successful.");

                    string sql = "SELECT Id, Name, Sku, Price, Availability FROM Products";

                    using (BigcommerceCommand command = new BigcommerceCommand(sql, connection))
                    using (BigcommerceDataAdapter adapter = new BigcommerceDataAdapter(command))
                    {
                        DataTable productsTable = new DataTable();
                        adapter.Fill(productsTable);

                        foreach (DataRow row in productsTable.Rows)
                        {
                            int id = row.Field("Id");
                            string name = row.Field("Name") ?? string.Empty;
                            string sku = row.Field("Sku") ?? string.Empty;
                            decimal price = row.Field("Price") ?? 0m;
                            string availability = row.Field("Availability") ?? string.Empty;

                            Console.WriteLine($"ID: {id} | Name: {name} | SKU: {sku} | Price: {price:C} | Availability: {availability}");
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("An error occurred: " + ex.Message);
            }
        }
    }
}
PM> Install-Package Devart.Data.Bigcommerce
using System.Linq;

namespace BigcommerceEFCore
{
    class Program
    {
        static void DisplayProducts()
        {
            using (var context = new BigcommerceModel())
            {
                var products = context.Products
                    .Select(p => new { p.Id, p.Name, p.Sku, p.Price, p.Availability })
                    .ToList();
                    
                foreach (var product in products)
                {
                    Console.WriteLine($"ID: {product.Id}");
                    Console.WriteLine($"Name: {product.Name}");
                    Console.WriteLine($"SKU: {product.Sku}");
                    Console.WriteLine($"Price: {product.Price:C}");
                    Console.WriteLine($"Availability: {product.Availability}");
                    Console.WriteLine(new string('-', 20));
                }
            }
        }
        
        static void Main(string[] args)
        {
            try
            {
                DisplayProducts();
            }
            catch (Exception ex)
            {
                Console.WriteLine("An error occurred: " + ex.Message);
            }
        }
    }
}
PM> Install-Package Devart.Data.Bigcommerce.EFCore
using System.Data;
using Devart.Data.Bigcommerce;

namespace BigcommerceConsoleApp
{
    class Program
    {
        static void Main(string[] args)
        {
            string connectionString = $"API Version=v3;Authentication Type=OAuth;Store Id=*****;Client Id=*****;Access Token=*****;License Key=*****";

            try
            {
                using (BigcommerceConnection connection = new BigcommerceConnection(connectionString))
                {
                    connection.Open();
                    Console.WriteLine("Connection successful.");

                    // Insert a new Product using a parameterized BigcommerceCommand
                    Console.WriteLine("\nInserting a sample Product via BigcommerceCommand...");
                    string insertSql = @"INSERT INTO Products
                        (Name, Type, Sku, Price, Weight, Categories, Availability)
                        VALUES (@Name, @Type, @Sku, @Price, @Weight, @Categories, @Availability)";

                    using (BigcommerceCommand insertCmd = new BigcommerceCommand(insertSql, connection))
                    {
                        // Devart Bigcommerce provider matches parameter names without the '@' prefix.
                        insertCmd.Parameters.AddWithValue("Name", "Sample Product via Command");
                        insertCmd.Parameters.AddWithValue("Type", "physical");
                        insertCmd.Parameters.AddWithValue("Sku", "SAMPLE-SKU-001");
                        insertCmd.Parameters.AddWithValue("Price", 29.99m);
                        insertCmd.Parameters.AddWithValue("Weight", 1.5m);
                        insertCmd.Parameters.AddWithValue("Categories", "[2095]");
                        insertCmd.Parameters.AddWithValue("Availability", "available");

                        int affected = insertCmd.ExecuteNonQuery();
                        Console.WriteLine($"Insert complete. Rows affected: {affected}\n");
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("An error occurred: " + ex.Message);
            }
        }
    }
}
PM > Install-Package Devart.Data.Bigcommerce
using System.Data;
using Devart.Data.Bigcommerce;

namespace BigcommerceConsoleApp
{
    class Program
    {
        static void Main(string[] args)
        {
            string connectionString = $"API Version=v3;Authentication Type=OAuth;Store Id=*****;Client Id=*****;Access Token=*****;License Key=*****";

            try
            {
                using (BigcommerceConnection connection = new BigcommerceConnection(connectionString))
                {
                    connection.Open();
                    Console.WriteLine("Connection successful.");

                    // Example: UPDATE with parameters
                    BigcommerceCommand cmd = connection.CreateCommand();
                    cmd.CommandText = "UPDATE Products SET Categories = :categories WHERE Name = :name";
                    cmd.Parameters.Add("categories", DbType.String).Value = "[2095]";
                    cmd.Parameters.Add("name", DbType.String).Value = "Sample Product via Command";

                    int affected = cmd.ExecuteNonQuery();
                    Console.WriteLine($"Updated {affected} row(s).");
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("An error occurred: " + ex.Message);
            }
        }
    }
}
PM> Install-Package Devart.Data.Bigcommerce
using System.Data;
using Devart.Data.Bigcommerce;

namespace BigcommerceConsoleApp
{
    class Program
    {
        static void Main(string[] args)
        {
            string connectionString = $"API Version=v3;Authentication Type=OAuth;Store Id=*****;Client Id=*****;Access Token=*****;License Key=*****";

            try
            {
                ExecuteUpdate(connectionString);
            }
            catch (Exception ex)
            {
                Console.WriteLine("An unexpected error occurred: " + ex.Message);
                Console.WriteLine(ex.ToString());
            }
        }

        static void ExecuteUpdate(string connectionString)
        {
            using (var myConnection = new BigcommerceConnection(connectionString))
            using (var myCommand = new BigcommerceCommand(
                "UPDATE Products SET Categories = '[2095]' WHERE Name = 'Sample Product via Command'", myConnection))
            {
                try
                {
                    myConnection.Open();
                    Console.WriteLine("Connection opened. Executing update...");
                    int rowsAffected = myCommand.ExecuteNonQuery();
                    Console.WriteLine("Operation complete. Rows Affected: " + rowsAffected);
                }
                catch (Exception ex)
                {
                    Console.WriteLine("Error during execution: " + ex.Message);
                    Console.WriteLine(ex.ToString());
                }
                finally
                {
                    if (myConnection.State != ConnectionState.Closed)
                        myConnection.Close();
                }
            }
        }
    }
}
PM> Install-Package Devart.Data.Bigcommerce

Documentation

Licensing
Licensing
A detailed technical reference on embedding license information – a required resource for applications built with dotConnect for BigCommerce.
DataAdapter Features
DataAdapter features
A comprehensive guideline on using the BigcommerceDataAdapter Class for interacting with BigCommerce data in a disconnected architecture.
Parameters
Parameters
An overview of SQL query parameters and their synchronization, along with practical insights into working with stored procedures.
SQL translation
SQL translation
Since remote execution is significantly faster than client-side processing, using translatable SQL ensures optimal query performance.

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 BigCommerce?
dotConnect for BigCommerce 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.
Why do I need to install the product if NuGet is available?

dotConnect for BigCommerce provides two sets of assemblies, and the choice depends on your project type:

  • For .NET Framework projects: Use the Devart assemblies included with the product installer.
  • For .NET (.NET Core/.NET 5+) projects: Use the assemblies available via NuGet packages.
Where should I apply my License Key?

The method for applying your license depends on your project type:

  • For .NET (.NET Core/.NET 5+) projects, apply the License Key at runtime using the License Key connection string parameter.
  • For .NET Framework projects, no license key is necessary. Download and install the licensed version of dotConnect from your Devart Customer Portal.
Do the end users of my application need a Devart license, or do I have to pay additional fees for deploying my software?

No, end users do not need a Devart license, and there are no additional deployment fees, as long as you hold a valid Devart license.

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

  • Devart.Data.Bigcommerce.dll
  • Devart.Data.dll

You can include them in your app's folder (such as Bin for web apps) or register them in the GAC. Just make sure to use them in your solution only.

There's no need for a full installation on the target machine, you can also use the "Minimal installation" option provided by the setup. It does not affect any other dotConnect components.

How can I update dotConnect to a new version?

To update dotConnect to a new version, you need to reinstall it:

  • 1. Open Settings > Apps > Installed apps in Windows.
  • 2. Uninstall the current and any older versions of dotConnect, including Entity Developer and LinqConnect, if installed.
  • 3. Visit the Customer Portal and download the latest licensed version.
  • 4. Install the downloaded version and receive the latest features and improvements.
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\...\Community\Common7\IDE\Extensions\Devart
  • C:\Program Files\Microsoft Visual Studio\...\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.

Wield the full firepower of dotConnect for BigCommerce
Go with the advanced edition of dotConnect for BigCommerce and stay at the top of your game from day one!