I think you've misunderstood. You don't need to read the barcode in the LINQ to SQL code - the barcode has already been read, and it is sitting in the identifier variable. The GetTrainInfo method is not supposed to return the TrainsInfoDataContext, it is supposed to use the TrainsInfoDataContext to grab the TrainsInfo object for the identifier.

Each time a barcode is read, the following happens:
TextBox1 is populated with the barcode data.
ProcessTrainIdentifier is called with the contents of the TextBox in the identifier variable
GetTrainInfo is called, passing that identifier through.
GetTrainInfo uses the identifier to return a record representing a single train
DisplayTrainInfo is called with the returned traininfo value
DisplayTrainInfo writes values from the traininfo object on to the UI.