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 the
WithCloudSecureConnectionBundlemethod call, and your credentials in the
WithCredentialsmethod 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.