The Vertica ADO.NET driver provides a data source for Vertica, so a client can connect and read/write data. The driver is written in C# and built on .NET. The published version can be found on NuGet here.
See the available data types, commands, and other information here.
- .NET Core 3.1+, or .NET Framework 4.6.1+
- A running Vertica database
ℹ️ Note that you will need to use .NET Core, not .NET Framework, if using Linux or Mac. It is recommended to use .NET 6.0 since it is a long-term support version.
Follow the instructions for Windows, Linux, or macOS.
If you don't already have a Vertica instance running, it is recommended to use the Vertica Community Edition (CE) Docker image.
Start Vertica CE in Docker:
docker run -d \
-p 5433:5433 -p 5444:5444 \
-v vertica-data:/data \
--name vertica-ce \
--restart=unless-stopped \
vertica/vertica-ce:latest
- Modify the
app.config
connection string and query as needed (note thatapp.config
is copied to the build directory asSampleApp.dll.config
during the build) - Build the application:
dotnet build
- Run the application:
dotnet run --framework net6.0
ℹ️ Note that the sample app produces binaries for multiple target .NET versions: .NET 6.0, .NET Core 3.1, and .NET Framework 4.6.2 (Windows only). The above example only shows .NET 6.0.
If there is a pre-release version of the driver available on NuGet, you will need to reference the specific version in your project.
For example, to reference 24.1.0
, modify the project file PackageReference
as follows:
<ItemGroup>
<PackageReference Include="Vertica.Data" Version="24.1.0" />
</ItemGroup>
If you have the Vertica ADO.NET driver DLL, you can update the project to use the DLL directly:
- Copy the Vertica ADO.NET driver DLL (
Vertica.Data.dll
) to thelib
folder - Replace the existing packages reference in the project file with the following:
<ItemGroup>
<Reference Include="Vertica.Data">
<HintPath>lib\Vertica.Data.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="6.0.0" />
</ItemGroup>
- Build and run the application, same as above
If you have the Vertica ADO.NET driver NuGet package, you can update the project to use the package directly:
- Copy the Vertica ADO.NET driver NuGet package (
Vertica.Data.<VERSION>.nupkg
) to thepackages
folder - Add the following to a
nuget.config
file in this directory:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<packageSources>
<add key="LocalPackages" value="packages" />
</packageSources>
</configuration>
- Update the Vertica.Data package reference version in the project file as needed
- Build and run the application, same as above