VBSyntax WithStatement
VBSyntax WithStatement
NET Guide
Useful Statements
EG:
With objDS.Tables(0)
objRow = .NewRow
objRow (“UserName”) = txtName.Text
objRow (“HighScore”) = txtScore.Text
.Rows.Add(objRow)
End With
objRow = objDS.Tables(0).NewRow
objRow(“UserName”) = txtName.Text
objRow(“HighScore”) = txtScore.Text
objDS.Tables(0).Rows.Add(objRow)
As can be seen, the WITH statement avoids repetition of objDS.Tables(0) as a full stop
indicates that it is to be used as a prefix.
Page 1 of 1