dotConnect for SQL Server is an enhanced data provider for SQL Server that builds on ADO.NET technology and SqlClient to present a complete solution for developing SQL Server-based database applications. The provider works with .NET Frameworks 2.0+, .NET Core 2.0+, .NET 5+. It includes base-class-based provider model, provider factories, connection string builder, metadata schemas, asynchronous commands, pooling enhancements, batch update support, provider-specific types, server enumeration, database change notification support and so on. More information at https://www.devart.com/dotconnect/sqlserver/ License See pricing options for ordering https://www.devart.com/dotconnect/sqlserver/ordering.html The NuGet package initiates the retrieval of an activation key from the Devart website. This key is required to activate the product for a free trial. Key Features * Easy Connection: Allows your application to work with SQL Server. * Performance: Uses many SQL Server-specific performance features & optimizations to ensure the highest performance. * Monitoring: Allows per-component tracing of database events with a free dbMonitor application. * Security: Supports various encryption ciphers, SSL and SSH connections, etc. * Support and updates: Enjoy dedicated support team for prompt issue resolution and regular updates to keep your software running smoothly and securely.
$ dotnet add package Devart.Data.SqlServerdotConnect for SQL Server is an enhanced data provider for SQL Server that builds on ADO.NET technology and SqlClient to present a complete solution for developing SQL Server-based database applications.
The provider works with .NET Frameworks 2.0+, .NET Core 2.0+, .NET 5+.
It includes base-class-based provider model, provider factories, connection string builder, metadata schemas, asynchronous commands, pooling enhancements, batch update support, provider-specific types, server enumeration, database change notification support and so on.
More information at dotConnect for SQL Server.
The following table show which version of this package to use with which version of frameworks.
| Frameworks | Version support |
|---|---|
| .NET | 10, 9, 8, 7, 6, 5 |
| .NET Core | 3, 2 |
| .NET Framework | 4.8, 4.7, 4.6.2, 4.6.1 |
More information here
For projects, using general ADO.NET functionality of dotConnect for SQL Server, you need to install the Devart.Data.SqlServer package. Execute the following command in the Package Manager Console:
Install-Package Devart.Data.SqlServer
See pricing options for ordering.
The NuGet package initiates the retrieval of an activation key from the Devart website. This key is required to activate the product for a free trial.
In this example, a new instance of the SqlServerConnection class (part of the Devart.Data.SqlServer namespace) is created.
using Devart.Data.SqlServer;
...
SqlConnection sqlConnection = new SqlConnection();
sqlConnection1.Server = "127.0.0.1";
sqlConnection1.UserId = "user";
sqlConnection1.Password = "mypassword";
sqlConnection1.Database = "Test";
This snippet simplifies the SQL Server connection setup by directly assigning a connection string to the ConnectionString property of the SqlServerConnection object
connection.ConnectionString = "Server=127.0.0.1;UserId=user;Password=mypassword;";Configuration File Snippet (appsettings.json):
{
"ConnectionStrings": {
"DefaultConnection": "Server=127.0.0.1;UserId=user;Password=mypassword;"
}
}Dependency Injection of IConfiguration:
private readonly IConfiguration configuration;
public YourController(IConfiguration config)
{
configuration = config;
}Retrieving a Connection String:
var connectionString = configuration.GetConnectionString("DefaultConnection");
var connection = new SqlServerConnection(connectionString);