Adding lines of data to a dataTable in asp.net using VB.net

adding rows to a data table I miss the first record
'Open connection
        cn.Open()
        cmd = New iDB2Command(sqlstring, cn)

        Dim rdr As iDB2DataReader
        rdr = cmd.ExecuteReader
        rdr.Read()

        dt.Columns.Add("Auth")
  While rdr.Read()
   Dim R As DataRow = dt.NewRow
            R("Auth") = rdr("domkey").ToString

 dt.Rows.Add(R)
        End While
        WebDataGrid1.DataSource = dt
        WebDataGrid1.DataBind()

Open in new window

LVL 2
bergertimeAsked:
Who is Participating?
 
dovidfCEOCommented:
You're welcome.
0
 
dovidfCEOCommented:
Why do you need the rdr.Read() above the while loop?
0
 
bergertimeAuthor Commented:
To screw up my code.  lol.  Thanks, that shouldn't have been there.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.