asp.net vb existing datatable add row

Joined
Nov 8, 2006
Messages
5
Reaction score
0
I need to add rows to an existing (maybe) datatable in a dataset that combines the IIS6 index search with my own sql table. I keep getting object reference errors. Anybody help me out? Much thanks.

Code:
        If ds.Tables("list").Rows.Count > 0 Then
            For Each k As Data.DataRow In ds.Tables("list").Rows
                Dim myDate As String
                If Convert.ToInt32(k.Item("structure")) = 4 Then
                    myDate = "Online - " & k.Item("eTitle").ToString
                Else
                    myDate = k.Item("mDate").ToString & "  - " & k.Item("eTitle").ToString
                End If
                Dim objRow As System.Data.DataRow = ds.Tables("listSearch").NewRow
                objRow("filename") = "Some Class"
                objRow("characterization") = myDate
                objRow("rank") = "1100"
                objRow("path") = "SomePath.apsx?eid=22"
                ds.Tables("listSearch").Rows.Add(objRow)
            Next
        End If
 
Joined
Nov 8, 2006
Messages
5
Reaction score
0
Figured out what I was doing wrong. I was binding the first dataset and then adding the second set so it didn't get added to the display. Switched things around and it's working beautifully now. Sorry to be so dense. Hope this helps someone else.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top