cancel
Showing results for 
Search instead for 
Did you mean: 

using datareader record count showing one less

0 Kudos

I'm using crystal report in my x64 windows system using asp.net. I have a scenario where more than 25 lacs records coming through a dynamic query. using datatable i'm gettign system outof memory issue, so i used on datareader instead datatable. everything works fine but total records of the formula returning 1 value less.

here is my formula

totext(Count ({ado.Student}) ,0) + " records selected" --student is one of the column

Suppose if I got total of 20 records in sql query then it's showing like "20 records selected" it's works fine until I'm using datatable. but it's failed when I changed to datatareader. it's showing like "19 records selected". I verified the sql data before the query execution. and front end also i'm getting the total records. only issue is total records. can any one helps me for this

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Are you using a CR SDK to connect to your data reader?

Need more details

Maybe your data reader is zero based and you are using 1 based?

Try this:

totext((Count +1)({ado.Student}) ,0) + " records selected" --student is one of the column

Answers (1)

Answers (1)

0 Kudos

If the link and tables don't have a 1 to 1 match it may miss data.

Be sure to use if isNull to the formulae.

Click the F1 key to get help on using the isnull function or search this tag for more samples

0 Kudos

we found first record is missing using datareader. can any one helps me why it is missing the first record

0 Kudos

if we have only record then it's not showing using datareader