CLIPER Level: Big Cheese Registered: 26-07-2005 Posts: 27
ASP.NET Import/Export
Hi, I would like to have a asp.net application that will let me extract or import data automatically to my Access Database. For that, I have a .csv file and I will then upload it and will be extracted into one of the table in my Access Database. Is there any feauture that ASP.NET can easily do? Is "IO" related to this? Could anyone poiunt out any feautures that will help me do this?
____________________________
CLIPER
23-02-2006 at 07:06 PM
|
~Bean~ Level: VB Guru Registered: 07-04-2003 Posts: 488
Re: ASP.NET Import/Export
Yes, System.IO namespace is used for this. Use a StreamReader for file access...
Something like:
Dim file As New System.IO.StreamReader("c:\test.txt")
Dim oneLine As String
oneLine = file.ReadLine()
While (oneLine <> "")
Dim myArray() As String = Split(oneLine, ",")
'Now do somethign mith your array (i.e., save to DB)
...
oneLine = file.ReadLine()
End While
file.Close()
____________________________
Eggheads unite! You have nothing to lose but your yolks.
24-02-2006 at 08:13 PM
|
CLIPER Level: Big Cheese Registered: 26-07-2005 Posts: 27
Re: ASP.NET Import/Export
quote:~Bean~ wrote:
Yes, System.IO namespace is used for this. Use a StreamReader for file access...
Something like:
Dim file As New System.IO.StreamReader("c:\test.txt")
Dim oneLine As String
oneLine = file.ReadLine()
While (oneLine <> "")
Dim myArray() As String = Split(oneLine, ",")
'Now do somethign mith your array (i.e., save to DB)
...
oneLine = file.ReadLine()
End While
file.Close()