public override IPooledDbConnection CreateConnection(IConnectionPool pool, 
		                                                      DatabaseConnectionSettings settings, 
		                                                      out string error)
        {
            string connStr = null;
            try {
                if (settings.UseConnectionString) {
                    connStr = settings.ConnectionString;
                } else {
                    //"mongodb://[username:password@]hostname[:port][/[database][?options]]"
                    //Default port is 27017.
                    if(!string.IsNullOrEmpty(settings.Username) && !string.IsNullOrEmpty(settings.Password)) {
                        connStr = String.Format("mongodb://{3}:{4}@{0}:{1}/{2}",
                        settings.Server, settings.Port, settings.Database, settings.Username, settings.Password);
                    } else {
                        connStr = String.Format("mongodb://{0}:{1}/{2}",
                        settings.Server, settings.Port, settings.Database);
                    }

                }
                MongoDbConnection connection = new MongoDbConnection(connStr, settings.Database);
                connection.Open();
                error = null;
                return new MongoDbPooledDbConnection (pool, connection);
            } catch (Exception e) {
                error = e.Message;
                return null;
            }
        }
 public MongoDbCommand(string commandText, MongoDbConnection dbConn, IDbTransaction trans)
 {
     command = commandText;
     parent_conn = dbConn;
     transaction = trans;
 }
 public MongoDbCommand(string commandText, MongoDbConnection dbConn)
 {
     command = commandText;
     parent_conn = dbConn;
 }