Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Whats the quickest way to locate a record line by line or SeekOrigin

Status
Not open for further replies.

yongbum

Programmer
Dec 15, 2005
48
IL
Hi
I have a large print file which contains records for about 5000 individuals, each record is about 50 lines of text. In my web app I want each person that has a record in the file to be able to retrieve it. I store the record location (currently the line no. within the file) together with their ID number in an SQL Server Database.
My question is what is the quickest way to arrive at the location and retrieve the record, should I read the file line by line or should I use SeekOrigin and Offeset to arrive directley at the location.?
Please include a short coding sample of the best method to use.

Thanks
 
Out of curiosity, why aren't you putting these records in an indexed database? The code will be simpler, faster, and more stable.
 
I agree but that's a project on its own. The system already exists and I need a solution in the mean time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top