Answers for "blazor application to connect to database"

0

blazor application to connect to database

public class DataAccessService
{
    private   IConfiguration config;
    public  DataAccessService(IConfiguration configuration)
    {
        config = configuration;
    }

    private  string ConnectionString
    {
        get
        {
    string _server = config.GetValue<string>("DbConfig:ServerName");
    string _database = config.GetValue<string>("DbConfig:DatabaseName");
    string _username = config.GetValue<string>("DbConfig:UserName");
    string _password = config.GetValue<string>("DbConfig:Password");

    return ($"Server={_server};Database={_database};User ID={_username};Password={_password};Trusted_Connection=False;MultipleActiveResultSets=true;");
        }
    }
  }
Posted by: Guest on January-29-2021

Code answers related to "blazor application to connect to database"

Browse Popular Code Answers by Language