I am having problems with the fact that I cannot connect to the new database that I created in MongoHQ.
I want to include the correct connection string in my Web.config file and bind my Mongo object to the database connection.
Connection strings (edited, obviously):
General access
mongo flame.mongohq.com:27065/dunedin -u {username} -p {password}
AWS Internal Access
mongo flame.local.mongohq.com:27065/dunedin -u {username} -p {password}
Obviously, I included my correct username in the password instead of placeholders in curly braces.
My code is:
string connection = ConfigurationManager.ConnectionStrings["DBMongo"].ConnectionString; var mongo = new Mongo(connection); mongo.Connect();
However, as soon as I try to instantiate this Mongo object, I get a format exception saying
Invalid connection string:
What should be this connection string for remote MongoDB instances?
EDIT:
Writing a connection string to Web.Config
<add name="DBMongo" connectionString="mongo flame.mongohq.com:27065/dunedin -u ausername -p apassword"/>
source share