TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Kiran Thakur
NA
9
1.1k
Not returning any value in MongoDB using MongoClient C#
Jan 12 2017 7:44 AM
Hi,
I have written following code.Code run fine but its not returning any value but my table have more than 500 records. Please do reply ASAP.
static
void
Main(
string
[] args)
{
CallMain(args).Wait();
Console.ReadLine();
}
static
async Task CallMain(
string
[] args)
{
var conString =
"myConnectionString"
;
var Client =
new
MongoClient(conString);
var DB = Client.GetDatabase(
"DatabaseName"
);
var collection = DB.GetCollection<BsonDocument>(
"TableName"
);
using
(var cursor = await collection.Find(
new
BsonDocument()).ToCursorAsync())
{
while
(await cursor.MoveNextAsync())
{
foreach
(var doc
in
cursor.Current)
{
Console.WriteLine(doc);
}
}
}
Reply
Answers (
1
)
Simple program in c#
How to find a child HWND of a child window of a child window