so, by adding the Return keyword inside my loop, it gives me all the info. for microsoft.
how do i get the info. for dell or sun? when i select that from the combo box.
VB Code:
  1. Do Until sr.Peek() = -1
  2.             myObject = New stocks 'Create the new instance.
  3.             myObject.Company() = sr.ReadLine() 'Read the name from the first line.
  4.             myObject.Shares = Convert.ToInt32(sr.ReadLine())  'Read the number of shares from the second line.
  5.             myObject.PurchasePrice = Convert.ToDecimal(sr.ReadLine())  'Read the share price from the third line.
  6.             myObject.PurchaseDate = Date.ParseExact(sr.ReadLine(), "dd/MM/yyyy", Nothing)    'Read the date from the fourth line in the specific format.
  7.             myObjects.Add(myObject) 'Add the new instance to the collection.
  8.             Return
  9.         Loop