How To Make Connection With MongoDb Using C# Asp.net
String connectionString = "mongodb://localhost";
MongoClient client = new MongoClient(connectionString);
MongoServer mdb= client.GetServer();
MongoDatabase database = mdb.MongoConnections("NetCrawlerDemo");
MongoCollection collection = database.GetCollection<"SGATableFind">("DA_TrackerInfo_SGA");
MongoCursor<"BsonDocument"> cursor = collection.FindAllAs<"BsonDocument">();
DataTable dt = new DataTable();
dt.Columns.Add("_id", typeof(MongoDB.Bson.ObjectId));
dt.Columns.Add("DA_TrackerID", typeof(Int32));
dt.Columns.Add("DA_Group", typeof(string));
dt.Columns.Add("DA_SubGroup", typeof(string));
dt.Columns.Add("DA_SearchEngine", typeof(string));
dt.Columns.Add("DA_WebSiteURL", typeof(string));
dt.Columns.Add("DA_ArticleHeader", typeof(string));
dt.Columns.Add("DA_ArticleDescription", typeof(string));
dt.Columns.Add("DA_ArticleDetails", typeof(string));
dt.Columns.Add("DA_CompanyName", typeof(string));
dt.Columns.Add("DA_AdditionalKeyword", typeof(string));
dt.Columns.Add("DA_ArticleDateTime", typeof(string));
dt.Columns.Add("DA_ArticleYear", typeof(string));
dt.Columns.Add("DA_ArticleMonth", typeof(string));
dt.Columns.Add("DA_ArticleDay", typeof(string));
dt.Columns.Add("DA_DateTime", typeof(DateTime));
foreach (var item in cursor)
{
dt.Rows.Add(item["_id"], item["DA_TrackerID"], item["DA_Group"], item["DA_SubGroup"], item["DA_SearchEngine"],
item["DA_WebSiteURL"], item["DA_ArticleHeader"], item["DA_ArticleDescription"], item["DA_ArticleDetails"], item["DA_CompanyName"]
, item["DA_AdditionalKeyword"], item["DA_ArticleDateTime"], item["DA_ArticleYear"], item["DA_ArticleMonth"], item["DA_ArticleDay"]
, item["DA_DateTime"]);
}
grid1.DataSource = dt;
mongo c# connection string | ||
mongo c# contains | ||
mongo c# count | ||
mongo c# create index | ||
mongo c# cursor | ||
mongo c# distinct | ||
mongo c# driver 1.10 | ||
mongo c# driver example | ||
mongo c# driver github |
ucuz takipçi
ReplyDeleteucuz takipçi
tiktok izlenme satın al
binance güvenilir mi
okex güvenilir mi
paribu güvenilir mi
bitexen güvenilir mi
coinbase güvenilir mi
MMORPG OYUNLAR
ReplyDeleteİnstagram Takipci Satın Al
tiktok jeton hilesi
TÄ°KTOK JETON HÄ°LESÄ°
Sac Ekim Antalya
referans kimliÄŸi nedir
instagram takipçi satın al
metin2 pvp serverlar
Takipci satın al
perde modelleri
ReplyDeletesms onay
mobil ödeme bozdurma
NFT NASIL ALÄ°NÄ°R
ankara evden eve nakliyat
TRAFÄ°K SÄ°GORTASÄ°
DEDEKTOR
web sitesi kurma
AÅžK KÄ°TAPLARI