1
Answer

not able to make connection to remote server in c#

amit thakur

amit thakur

8y
1.2k
1
const string connectionString ="mongodb://username:[email protected]:27017/Eventlog";
MongoClientSettings settings = MongoClientSettings.FromUrl(new MongoUrl(connectionString));
var client = new MongoClient(settings);
var server = client.GetServer();
var db = server.GetDatabase(databaseName);

Answers (1)