hi all, am just curious to know...which is the better or more efficient way of these two?
Note: tblOD is a DataTable
For dtrows As Long = 0 To tblOD.Rows.Count - 1
dgv1.Rows.Add(tblOD(dtrows)(0), tblOD(dtrows)(1), _
tblOD(dtrows)(2), _
tblOD(dtrows)(3), tblOD(dtrows)(4), _
tblOD(dtrows)(5), tblOD(dtrows)(6), _
tblOD(dtrows)(7))
Next dtrows
OR
With tblOD
For dtrows As Long = 0 To .Rows.Count - 1
dgv1.Rows.Add(.Rows(dtrows)(0), .Rows(dtrows)(1), _
.Rows(dtrows)(2), _
.Rows(dtrows)(3), .Rows(dtrows)(4), _
.Rows(dtrows)(5), .Rows(dtrows)(6), _
.Rows(dtrows)(7))
Next dtrows
End With
Thank You!!!