Re: Connect to mongoDB with visual studio 2012 and mongodb c++ driver

804 views
Skip to first unread message

Eric Milkie

unread,
May 22, 2013, 9:35:05 PM5/22/13
to mongod...@googlegroups.com
Can you connect using the MongoDB shell?  Make sure that is working first.  The shell uses what is basically the C++ driver to connect, so it is a good way to determine if the problem is with your server config or with your use of the C++ driver.

Amit De

unread,
Mar 17, 2014, 12:45:43 PM3/17/14
to mongod...@googlegroups.com
Well, I am having a similar issue. I am able to connect using CMD shell. All querries are executed successfully. I want to enter a query in text box like - db.collectionname.find({"id":300})   and then execute it using vb.net itself.

Could you help please?
Following is my code till now.

Imports MongoDB.Bson
Imports MongoDB.Driver
Imports MongoDB.Driver.Builders


Public Class frmMongoDB
     Sub MongoDB()
        Dim client As MongoClient
        Dim server As MongoServer
        Dim db As MongoDatabase
        Dim col1 As MongoCollection
        client = New MongoClient("mongodb://localhost")
        server = client.GetServer()
        db = server.GetDatabase("db1")
        col1 = db.GetCollection("table1")
        Dim query = New QueryDocument("  ")

Stephen Steneker

unread,
Mar 24, 2014, 12:33:55 AM3/24/14
to mongod...@googlegroups.com
Hi Amit,

Please don't reply to old discussions .. versions of server and drivers may no longer be relevant and it is easy for your reply to be lost ;-).

In this case the original issue was with the C++ driver, whereas your issue is apparently with the .NET driver via VB.

Can you start a new discussion with details of your environment (C#/.NET driver version) and the error message you are receiving? You mention that all queries are executed successfully, so it's not clear what issue you need assistance with.

Thanks,
Stephen

Amit

unread,
Mar 24, 2014, 1:14:50 AM3/24/14
to mongod...@googlegroups.com

I never said my queries were executed successfully on vb.net platform with the c# driver. I just said that I'm unable to figure. The query execution statement on vb.net for running a query. I am not even sure if my connection string is right.I sent my code snippet for work done by me. I wanted help in getting it executed. Anyway
I'll further open a new thread and link you soon.

--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com
To unsubscribe from this group, send email to
mongodb-user...@googlegroups.com
See also the IRC channel -- freenode.net#mongodb

---
You received this message because you are subscribed to a topic in the Google Groups "mongodb-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mongodb-user/G3BZKssha4Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mongodb-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages