Which is the maximum selectables rows in mysql with c#? -


hello developening c# app selecting , comparing data on db, on table has more 500'000 records. using mysql connector, , going :

select * table  

from table. question is: recommended use select * without limit? can process gives problem if select 500000 records @ once, or should user limit selecting records in groups? asking beacause in vb got problems kind of select, makes stops program.

thanks all.

edit: select function:

public object[] queryselect(string query) {     idbcommand dbcmd = dbcon.createcommand();     dbcmd.commandtext = query;      idatareader reader= dbcmd.executereader();     arraylist result = new arraylist();      while (reader.read())     {         hashtable ht = new hashtable();         int fieldcount = reader.fieldcount;          (int = 0; < fieldcount; i++)             ht.add(reader.getname(i), reader[i]);          result.add(ht);     }     reader.close();      return result.toarray(); } 

i suppose use sqlcommand.executereader , sqldatareader read data. in case, not problem per se, because request each row in loop. if reading through rows , put result in list, yes, have problem, because trying put 500,000 items memory.

if don't put rows in list, process them somehow, can garbage collected afterwards, have no problem.

update:
updated question , showed method using. that's scenario, trouble, because result in arraylist instance 500,000 hastable instances.

btw:
nowadays should use generics, e.g. list<t> , dictionary<tkey, tvalue> instead of arraylist , hashtable. makes code type safe.


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -