First string field in first row of datatable shows "System.Data.DataRowView"

  • Thread starter Thread starter Nathan
  • Start date Start date
N

Nathan

Summary:

After filling a dataset from an access database table, the
first string column of the first row contains the
text "System.Data.DataRowView".

dcScorecards = New OleDb.OleDbCommand(sqlScorecards &
myGolfcourse.GolfcourseId & _
" Order by gcRating desc")
golfClub.Open()
dcScorecards.Connection = golfClub
daScorecards = New OleDb.OleDbDataAdapter
daScorecards.SelectCommand = dcScorecards
dsScorecards = New DataSet
daScorecards.Fill(dsScorecards, "gc_scorecard")
golfClub.Close()
dtScorecards = dsScorecards.Tables("gc_scorecard")

Where sqlScorecards = "Select gcScorecardId,
gcGolfcourseId, gcTee, gcSlope, " & _
"gcRating, gcPar, gcPar1, gcPar2, gcPar3, gcPar4,
gcPar5, gcPar6, gcPar7, " & _
"gcPar8, gcPar9, gcPar10, gcPar11, gcPar12,
gcPar13, gcPar14, gcPar15, " & _
"gcPar16, gcPar17, gcPar18, gcHcap1, gcHcap2,
gcHcap3, gcHcap4, gcHcap5, " & _
"gcHcap6, gcHcap7, gcHcap8, gcHcap9, gcHcap10,
gcHcap11, gcHcap12, gcHcap13, " & _
"gcHcap14, gcHcap15, gcHcap16, gcHcap17,
gcHcap18, gcDateCreated, gcCreatedBy " & _
"From gc_scorecard Where gcGolfcourseId = "

If I then use a statement like

For rowLoopIndex As Integer = 0 To
(dtScorecards.Rows.Count - 1)
Me.lblRatingSlope.Text = Me.lblRatingSlope.Text &
CRLF & _
dtScorecards.Rows(rowLoopIndex).Item("gcTee") & _
TAB & dtScorecards.Rows(rowLoopIndex).Item
("gcSlope") & TAB & _
dtScorecards.Rows(rowLoopIndex).Item("gcRating")
Next

To loop over the dataset table the first row column of
gcTee contains "System.Data.DataRowView". All subsequent
rows have the correct data.

I am stumped. If I change the sort it still shows up in
the first record. The integer fields show the correct
data. But the string data of this one field is incorrect
on the first row.
..
 
Back
Top