Click here to Skip to main content
16,011,804 members
Home / Discussions / C#
   

C#

 
AnswerRe: Updating the password handling Pin
BobJanova16-Nov-11 3:04
BobJanova16-Nov-11 3:04 
AnswerRe: Updating the password handling Pin
Luc Pattyn16-Nov-11 4:03
sitebuilderLuc Pattyn16-Nov-11 4:03 
GeneralRe: Updating the password handling Pin
Peter_in_278016-Nov-11 10:02
professionalPeter_in_278016-Nov-11 10:02 
GeneralRe: Updating the password handling Pin
Bernhard Hiller16-Nov-11 23:02
Bernhard Hiller16-Nov-11 23:02 
QuestionReading next block of data on button click event Pin
MumbleB15-Nov-11 18:55
MumbleB15-Nov-11 18:55 
AnswerRe: Reading next block of data on button click event Pin
RobCroll15-Nov-11 19:40
RobCroll15-Nov-11 19:40 
AnswerRe: Reading next block of data on button click event Pin
Wayne Gaylard15-Nov-11 19:42
professionalWayne Gaylard15-Nov-11 19:42 
AnswerRe: Reading next block of data on button click event Pin
BobJanova16-Nov-11 3:09
BobJanova16-Nov-11 3:09 
If it's only 50 records you should parse and read the entire file into a List<Record>, where a Record is a data holding class which is populated in a similar way to your code here, at the start. Working with a proper domain object with properties is much better than working with a string format the whole time.

To read all the records you do something like

List<Record> GetRecords(string s){
 List<Record> r = new List<Record>();
 ReadHeader(s.Substring(0, HEADER_LENGTH));
 s = s.Substring(HEADER_LENGTH);
 while(s.Length > 0){
  string recordstr = s.Substring(0, RECORD_LENGTH);
  s = s.Substring(RECORD_LENGTH);
  
  Record rec = new Record();
  rec.CO_ID = recordstr.Substring(0, 5); //= 5
  // etc
 
  r.Add(rec);
 }
 return r;
}


ed: HEADER_LENGTH = 463 and RECORD_LENGTH = 276.
QuestionTimers & editing controls Pin
Krylosac15-Nov-11 16:35
Krylosac15-Nov-11 16:35 
AnswerRe: Timers & editing controls Pin
Wayne Gaylard15-Nov-11 17:06
professionalWayne Gaylard15-Nov-11 17:06 
GeneralRe: Timers & editing controls Pin
Krylosac15-Nov-11 17:39
Krylosac15-Nov-11 17:39 
GeneralRe: Timers & editing controls Pin
Wayne Gaylard15-Nov-11 17:53
professionalWayne Gaylard15-Nov-11 17:53 
AnswerRe: Timers & editing controls Pin
Luc Pattyn15-Nov-11 17:28
sitebuilderLuc Pattyn15-Nov-11 17:28 
GeneralRe: Timers & editing controls Pin
BobJanova16-Nov-11 3:11
BobJanova16-Nov-11 3:11 
GeneralRe: Timers & editing controls Pin
Krylosac16-Nov-11 3:24
Krylosac16-Nov-11 3:24 
AnswerRe: Timers & editing controls Pin
Not Active15-Nov-11 17:28
mentorNot Active15-Nov-11 17:28 
QuestionHow To Create Classic Menu in C# desktop apll. Pin
Devdattahack1015-Nov-11 12:27
Devdattahack1015-Nov-11 12:27 
AnswerRe: How To Create Classic Menu in C# desktop apll. Pin
PIEBALDconsult15-Nov-11 13:42
mvePIEBALDconsult15-Nov-11 13:42 
Questionc# image pixel shrink Pin
Member 773856115-Nov-11 8:43
Member 773856115-Nov-11 8:43 
AnswerRe: c# image pixel shrink Pin
Peter_in_278015-Nov-11 13:23
professionalPeter_in_278015-Nov-11 13:23 
GeneralRe: c# image pixel shrink Pin
Smithers-Jones15-Nov-11 22:23
Smithers-Jones15-Nov-11 22:23 
AnswerRe: c# image pixel shrink Pin
BillWoodruff16-Nov-11 14:54
professionalBillWoodruff16-Nov-11 14:54 
QuestionQuick way to add block comments? Pin
jclark239b915-Nov-11 6:55
jclark239b915-Nov-11 6:55 
AnswerRe: Quick way to add block comments? PinPopular
OriginalGriff15-Nov-11 9:37
mveOriginalGriff15-Nov-11 9:37 
GeneralRe: Quick way to add block comments? Pin
jclark239b915-Nov-11 10:26
jclark239b915-Nov-11 10:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.