[CSHARP-403] cannot get connection string for replica set to work if including credentials and/or db-name Created: 22/Feb/12  Updated: 05/Apr/19  Resolved: 23/Feb/12

Status: Closed
Project: C# Driver
Component/s: None
Affects Version/s: 1.3.1
Fix Version/s: 1.4

Type: Task Priority: Minor - P4
Reporter: Stefan Rauchegger Assignee: Robert Stam
Resolution: Done Votes: 0
Labels: c#, connection, question, replicaset, windows
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows 2008 R2, mongodb 2.0.2, csharp driver 1.3.1



 Description   

mongodb://user1:pwd1@unvwin97:27017/myDBname,user1:pwd1@unvwin97:27018/myDBname

is neither working as connection string for MongoServer, MongoDatabase nor MongoUrlBuilder
Replicaset is not recognized properly, hence fail over is not working either



 Comments   
Comment by Robert Stam [ 23/Feb/12 ]

The username/password should only be provided once, and so should the database name.

Your connection string should look like this:

"mongodb://user1:pwd1@unvwin97:27017,unvwin97:27018/myDBname"

Generated at Wed Feb 07 21:36:43 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.