I'M trying to list all documents in a collection with mongodb and c#. Insert and delete performance is good. But when I try to list all items in a table (collection) mongo db just select 3000 row in a second. (By the way Sql Server express 200k in a second, mysql 111k, oracle express 111k, postgresql 91k and firebird 63k)
This is my select code.
var connectionString = "mongodb://localhost";
var client = new MongoClient(connectionString);
var server = client.GetServer();
var database = server.GetDatabase("testdb1");
var collection = database.GetCollection<Entity>("tablo1");
var entity = collection.FindAll();
foreach (var deger in collection.FindAll())
{
string[] row1 = new string[] { deger.deger1.ToString() };
dataGridView1.Rows.Add(row1);
Application.DoEvents();
}
Does anyone know better way to list all records to datagridview?
This is how i list with all other database systems.
NpgsqlDataAdapter dataadapter = new NpgsqlDataAdapter("SELECT * FROM tablo1", baglanti1);
DataSet ds = new DataSet();
baglanti1.Open();
dataadapter.Fill(ds, "tablo1");
baglanti1.Close();
dataGridView1.DataSource = ds;
dataGridView1.DataMember = "tablo1";
Can I use dataset and dataadapter with MongoDB?