|
Hi,
It seems that you’ve been having auth problem with your MongoDB. I would recommend to see MongoDB Enable Auth. You can also follow the steps listed on the page to setup and enable access control.
In regards to your snippet code, please see MongoDB C#: Make a Connection to see how to create a connection.
Note that you’re creating MongoClient
object twice in your code example.
Regards,
Wan.