Migrating C# driver
Complete the following procedure to migrate your existing DataStax C# driver to a version that is capable of connecting to Astra databases created using DataStax Astra DB.
-
Add the dependencies for the C# driver to your project. Latest
.
dotnet add package CassandraCSharpDriver -v <version>
-
In your existing DataStax C# driver code, modify the connection code to use the Astra DB API.
Include the absolute path to the secure connect bundle for your Cassandra database (
secure-connect-database_name.zip
) in theWithCloudSecureConnectionBundle
method call, and your credentials in theWithCredentials
method call, as shown in the following examples.var session = Cluster.Builder() .WithCloudSecureConnectionBundle(@"C:\path\to\secure-connect-database_name.zip") .WithCredentials("clientId", "clientSecret") .Build() .Connect();
-
Run your application.