'how to read provider name from appsetting to create database connection in dot net core 5.0
how to read provider name from appsetting to create database connection in dot net core 5.0
var cdsConnection = Convert.ToString(root.GetSection("ConnectionStrings:abc")); var providerName = Convert.ToString(root.GetSection("ConnectionStrings:abc_ProviderName"));
DatabaseFactory.SetDatabaseProviderFactory(new DatabaseProviderFactory(new SystemConfigurationSource(false).GetSection), false);
return DatabaseFactory.CreateDatabase(cdsConnection) as SqlDatabase;
getting error invalid database or provider name
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
