Exemple #1
0
        /// <summary>
        /// Creates the connection string  with the passed parameters
        /// </summary>
        /// <param name="server">The server.</param>
        /// <param name="database">The database.</param>
        /// <param name="username">The username.</param>
        /// <param name="password">The password.</param>
        /// <param name="useAuthenticatedProxy">if set to <c>true</c> [use authenticated proxy].</param>
        /// <returns>AceQLConnection.</returns>
        public static String Create(string server, string database, string username, string password, bool useAuthenticatedProxy)
        {
            Boolean enableDefaultSystemAuthentication = true;

            ConnectionStringBuilder connectionStringBuilder = new ConnectionStringBuilder();

            connectionStringBuilder.AddServer(server);
            connectionStringBuilder.AddDatabase(database);
            connectionStringBuilder.AddCredentials(username, password);

            if (enableDefaultSystemAuthentication)
            {
                connectionStringBuilder.AddEnableDefaultSystemAuthentication();
            }

            if (useAuthenticatedProxy)
            {
                connectionStringBuilder.AddAuthenticatedProy();
            }

            string connectionString = connectionStringBuilder.GetConnectionString();

            return(connectionString);
        }