when I run this it only shows the last row in the file. so it loops through the whole file and only puts the last row in. I know I need something to load the rows into and then pass that to the grid?
Can someone give me a hand with this?
DougP
Can someone give me a hand with this?
Code:
Dim Filename As String = Session("SPMIDTextFile")
Dim SPMIData As String
SPMIData = GetFileContents(Filename)
Dim strReader As New StringReader(SPMIData)
Dim SPMIDCostrakrArray As Array
Dim SPMIDCostrakrString As String = ""
Dim SPMID As String = ""
Dim Costrakr As String = ""
Do While strReader.Peek() >= 0
SPMIDCostrakrString = strReader.ReadLine()
SPMIDCostrakrArray = SPMIDCostrakrString.Split(",")
SPMID = SPMIDCostrakrArray(0)
Costrakr = SPMIDCostrakrArray(1)
Loop
GridView1.DataSource = SPMIDCostrakrArray
GridView1.DataBind()
DougP