Miss Piggy
October 13th, 2005, 04:54 AM
I am learning both Visual basic 6.0 and Visual Basic.NET. I'm not sure of how to import a text file to a datagrid.
Sub Main()
Dim objReader As New StreamReader("C:\Documents and Settings\attkxp1\Desktop\FYP-DataMiningTools\DataMining\DataMiningTool\FYP\Logs\HssRpcSvrLog.txt")
Dim sLine As String = ""
Dim arrText As New ArrayList
Do
sLine = objReader.ReadLine()
If Not sLine Is Nothing Then
arrText.Add(sLine)
End If
Loop Until sLine Is Nothing
objReader.Close()
For Each sLine In arrText
Console.WriteLine(sLine)
Next
Console.ReadLine()
End Sub
----took reference from the MSDN web site. Don't really know how or where should i start from.
Sub Main()
Dim objReader As New StreamReader("C:\Documents and Settings\attkxp1\Desktop\FYP-DataMiningTools\DataMining\DataMiningTool\FYP\Logs\HssRpcSvrLog.txt")
Dim sLine As String = ""
Dim arrText As New ArrayList
Do
sLine = objReader.ReadLine()
If Not sLine Is Nothing Then
arrText.Add(sLine)
End If
Loop Until sLine Is Nothing
objReader.Close()
For Each sLine In arrText
Console.WriteLine(sLine)
Next
Console.ReadLine()
End Sub
----took reference from the MSDN web site. Don't really know how or where should i start from.