I'm trying to connect to a program coded in C# to a mongoDB. I have created a new collection and I have inserted some data . I'm using mlab as host for my dataBase.
MongoClientSettings settings = new MongoClientSettings();
settings.Server = new MongoServerAddress("ds145128.mlab.com", 45128);
MongoClient client = new MongoClient(settings);
var db = client.GetDatabase("unknowndb");
var coll = db.GetCollection<Book>("book");
Please help me, when I execute the program, it show me a error message that I can't connect to the DB?
I connected like that
And my connection string like this. I connected to local mongodb. You can use MongoUrl