Hi all,
The 'reader' within the if statement is showing "Expression is not a method", what am I doing wrong?
Thanks
Dim reader As New CSVReader
OpenFileDialog2.Filter = "CSV File (*.csv)|*.csv"
OpenFileDialog2.RestoreDirectory = True
If OpenFileDialog2.ShowDialog() = DialogResult.OK Then
reader(OpenFileDialog2.FileName)
reader.DisplayResults(DataGridView1)
'Return OpenFileDialog2.FileName
Else
End If
I simply moved the Dim and it worked.
OpenFileDialog2.InitialDirectory = "a:"
OpenFileDialog2.Filter = "CSV File (*.csv)|*.csv"
OpenFileDialog2.RestoreDirectory = True
If OpenFileDialog2.ShowDialog() = DialogResult.OK Then
Dim reader As New CSVReader(OpenFileDialog2.FileName)
reader.DisplayResults(DataGridView1)
'Return OpenFileDialog2.FileName
Else
End If
Thanks