Will u plzz help me for displaying the content from the database in datagridview in vb with backend mongodb?

i'm not using mongoDB..

You can read the basic about connecting, get collection, store, and query here : https://code.msdn.microsoft.com/Getting-started-with-37dbd5bd

Example code :

Imports MongoDB.Bson 
Imports MongoDB.Dirver 
Imports Newtonsoft.Json 
Imports Newtonsoft.Json.Linq 

Module Module1 

    Sub Main() 

        Console.WriteLine("Connect...") 

        Dim mongo As MongoServer = MongoServer.Create() 
        mongo.Connect() 

        Console.WriteLine("Connected") 
        Console.WriteLine() 

        Dim db = mongo.GetDatabase("tutorial") 

        Using mongo.RequestStart(db) 
            Dim collection = db.GetCollection(Of BsonDocument)("books") 

            Dim book As BsonDocument = New BsonDocument() _ 
                .Add("_id", BsonValue.Create(BsonType.ObjectId)) _ 
                .Add("author", "Ernest Hemingway") _ 
                .Add("title", "For Whom the Bell Tolls") 

            collection.Insert(book) 

            Dim query = New QueryDocument("author", "Ernest Hemingway") 

            For Each item As BsonDocument In collection.Find(query) 
                Dim author As BsonElement = item.GetElement("author") 
                Dim title = item.GetElement("title") 

                Console.WriteLine("Author: {0}, Title: {1}", author.Value, title.Value) 

                For Each element As BsonElement In item.Elements 
                    Console.WriteLine("Name: {0}, Value: {1}", element.Name, element.Value) 
                Next 
            Next 
        End Using 

        Console.WriteLine() 
        Console.Read() 

        mongo.Disconnect 
    End Sub 

End Module

if you can display query result.. then convert/store it as datatable.

this's just an example how to bind datagrid, you have to make your own datatable based on your mongodb query.

Private Sub BindDataGridView()
    Dim dt As New DataTable()
    dt.Columns.AddRange(New DataColumn(2) {New DataColumn("Id", GetType(Integer)), New DataColumn("Name", GetType(String)), New DataColumn("Country", GetType(String))})
    dt.Rows.Add(1, "John Hammond", "United States")
    dt.Rows.Add(2, "Mudassar Khan", "India")
    dt.Rows.Add(3, "Suzanne Mathews", "France")
    dt.Rows.Add(4, "Robert Schidner", "Russia")
    Me.dataGridView1.DataSource = dt
End Sub
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.