bergertime
asked on
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()
Why do you need the rdr.Read() above the while loop?
ASKER
To screw up my code. lol. Thanks, that shouldn't have been there.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.