|
-
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.
-
October 13th, 2005, 07:07 AM
#2
Re: Visual Basic.NET--- How to open a text file and display the data into a datagrid.
Hello!
Here's an example I've found on PlanetSourceCode
Hope it helps!
Last edited by HanneSThEGreaT; December 19th, 2008 at 02:57 AM.
-
October 13th, 2005, 08:02 PM
#3
Re: Visual Basic.NET--- How to open a text file and display the data into a datagrid.
-
October 13th, 2005, 08:07 PM
#4
Re: Visual Basic.NET--- How to open a text file and display the data into a datagrid.
Sorry, I have another question. How to break the data that has been loaded to the datagrid into meaning columns. How to write the back code for breaqking them into columns to group the data in the text file? Thank you.
Last edited by Miss Piggy; October 16th, 2005 at 08:20 PM.
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
|