using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace lib
{
    public class DbImport5
    {
        static DbImport5 db = null;

        public SqlConnection conn { get; set; }

        public DbImport5(DbConfig config)
        {
            //string connetionString = @"Data Source={0};Initial Catalog={1};User ID={2};Password={3};Encrypt=False;TrustServerCertificate=False;Connection Timeout=30;";
            string connetionString = @"Data Source={0};Initial Catalog={1};User Id={2};Password={3};TrustServerCertificate=True;Connection Timeout=30;";
            conn = new SqlConnection(String.Format(connetionString,
                config.servername, config.database, config.username, config.password));
        }

        public static DbImport5 getInstance()
        {
            if (db == null)
            {
                db = new DbImport5(DbConfig.getInstance());
            }

            return db;
        }


    }
}
