I got a start any way this will read the trace files and get the data I want to summarize

vb.net Code:
  1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  2.         Dim textData As String = String.Empty
  3.         Dim dbId As Integer = 0
  4.         Dim duration As Integer = 0
  5.         Dim cpu As Integer = 0
  6.         Dim reads As Integer = 0
  7.         Dim writes As Integer = 0
  8.         Dim sTime As Date
  9.         Dim msg As String = String.Empty
  10.  
  11.         Dim myTraceFile As New Microsoft.SqlServer.Management.Trace.TraceFile
  12.         Dim fbFolder As New FolderBrowserDialog
  13.         fbFolder.ShowDialog()
  14.         Dim fName As New System.IO.DirectoryInfo(fbFolder.SelectedPath.Trim())
  15.         fbFolder.Dispose()
  16.         Dim allFiles As IO.FileInfo() = fName.GetFiles("*.trc")
  17.         For Each f As System.IO.FileInfo In allFiles
  18.             myTraceFile.InitializeAsReader(f.FullName())
  19.             Dim i As Integer = 0
  20.             While myTraceFile.Read()
  21.                 'EventClass  0  String
  22.                 'BinaryData  1      Byte()
  23.                 'DatabaseID  2      Int32
  24.                 'SPID        3      Int32
  25.                 'Duration    4      Int64
  26.                 'StartTime   5      DateTime
  27.                 'Reads       6      Int64
  28.                 'Writes      7      Int64
  29.                 'CPU         8      Int32
  30.                 'TestData    9      String
  31.                 'ObjectId   10      Int32
  32.                 textData = myTraceFile.GetString(9)
  33.                 If textData IsNot Nothing Then
  34.                     dbId = myTraceFile.GetInt32(2)
  35.                     msg = "DBId = " & dbId & System.Environment.NewLine
  36.                     duration = myTraceFile.GetInt64(4)
  37.                     msg &= "Duration: " & duration.ToString() & System.Environment.NewLine
  38.                     cpu = myTraceFile.GetInt32(8)
  39.                     msg &= "CPU: " & cpu.ToString() & System.Environment.NewLine
  40.                     sTime = myTraceFile.GetDateTime(5)
  41.                     msg &= "StartTime: " & sTime & System.Environment.NewLine
  42.                     reads = myTraceFile.GetInt64(6)
  43.                     msg &= "Reads: " & reads.ToString() & System.Environment.NewLine
  44.                     writes = myTraceFile.GetInt64(7)
  45.                     msg &= "Writes: " & writes.ToString() & System.Environment.NewLine
  46.                     msg &= "TextData: " & textData
  47.                     Me.TextBox1.Text = msg
  48.                 End If
  49.                 i += 1
  50.                 If i = 15 Then
  51.                     Exit While
  52.                 End If
  53.                 msg = String.Empty
  54.             End While
  55.             myTraceFile.Close()
  56.         Next
  57.         myTraceFile.Dispose()
  58.  
  59.     End Sub