Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help filling grid form .csv file

Status
Not open for further replies.

DougP

MIS
Dec 13, 1999
5,985
US
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?
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top