Esempio n. 1
0
        private SqlServer(ServerConnection serverConnection, SqlConnectionInfo.AuthenticationMethod authType, bool encrypted, bool trustServer, int?commandTimeout)
        {
            _server = new Server(serverConnection);
            serverConnection.EncryptConnection      = encrypted;
            serverConnection.TrustServerCertificate = trustServer;

            serverConnection.LoginSecure = true;

            if (authType == SqlConnectionInfo.AuthenticationMethod.SqlPassword)
            {
                serverConnection.LoginSecure = false;
            }

            if (commandTimeout != null)
            {
                _server.ConnectionContext.StatementTimeout = commandTimeout.Value;
            }
        }
Esempio n. 2
0
 public SqlServer(string server, string username, string password, SqlConnectionInfo.AuthenticationMethod authType, bool encrypted, bool trustServer, int?commandTimeout, WindowLogging loggingWindow)
     : this(new ServerConnection(server, username, password), authType, encrypted, trustServer, commandTimeout)
 {
     _loggingWindow = loggingWindow;
     ServerName     = server;
 }