N
Nigil LaVey
hi folks..
I have a question on Count(*) Property.. Is there any equivalent property
to specify or limit the number of records when using Count(*)?
cos I realized that when using Count(*) on a very large database.. it is
rather slow. The Count(*) property is actually looping through all records.
what I need is that when count > 2 then stop the looping.
I know by using the following code.. I can achieved that.. just that I do
believe that there must be a better way...
sqlCmd.CommandText="Select * From MyTable where MyID=5";
sqlReader=sql_Cmd.ExecuteReader();
if(sql_Reader.Read())
break;
all thoughts welcome,
Nigil Chua
I have a question on Count(*) Property.. Is there any equivalent property
to specify or limit the number of records when using Count(*)?
cos I realized that when using Count(*) on a very large database.. it is
rather slow. The Count(*) property is actually looping through all records.
what I need is that when count > 2 then stop the looping.
I know by using the following code.. I can achieved that.. just that I do
believe that there must be a better way...
sqlCmd.CommandText="Select * From MyTable where MyID=5";
sqlReader=sql_Cmd.ExecuteReader();
if(sql_Reader.Read())
break;
all thoughts welcome,
Nigil Chua