|
-
October 13th, 2005, 04:54 AM
#1
Visual Basic.NET--- How to open a text file and display the data into a datagrid.
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|