In my application i have millions of records in database my problem is i need to retrieve those millons of records from database
and bind them to datatable and after binding to datatable i am customizing the code and trying to retrive only the required
data the problem is i am unable to get those millions of records into datatable and finally getting the below exception
An exception of type 'System.OutOfMemoryException' occurred in System.Data.dll but was not handled in user code.
Hence i am planning to customize the data from my database only but i am unable to do it.below are my query's
select distinct c.receiverid,a.id,d.start,b.code,b.quantity,a.gross,b.net,b.clinician,c.filename,b.priorauthorizationid,c.transactiondate,d.pateintid,b.Claim_Id from
claims_sr a, activity_sr b, transaction_sr c,encounter_sr d
where a.claim_id=b.claim_id and a.claim_id=d.claim_id and a.filename=b.filename and a.filename=c.filename and a.filename=d.filename and a.id like '%OCR%' and c.TransactionDate between '01/01/2016' and '01/31/2017' order by c.TransactionDate
select distinct g.senderid,e.id,f.start,f.code,f.quantity,f.net,f.patientshare,f.paymentamount,f.clinician,e.filename, g.transactiondate,f.DenialCode --,e.PaymentReference
from claims_ra e, activity_ra f, transaction_ra g where
e.claim_id=f.claim_id and e.filename=f.filename and e.filename=g.filename and f.PaymentAmount='0.0000'
and e.id like '%OCR%' and g.TransactionDate between '01/01/2016' and '01/31/2017'order by g.transactiondate
For a particular claim in first table i have no of filenames out of all those filenames i have only one filename with sub
and i have multiple resub's for the same filename for that sub file name i need to retrieve the first two resub filenames along with its date from first query
and from second query i need to retrieve the latest ra filename along with date.
How can i filter them through query itself because when trying to filter through c# code i am getting System.OutOfMemoryException as i have millions of records in database
What I have tried:
How can i filter them through query itself because when trying to filter through c# code i am getting System.OutOfMemoryException as i have millions of records in database