We will introduce some typical data table related operations using the methods and properties of the DataTable Class
Example DataTable (variable name: DataTable):
1. Retrieve a DataColumn from a DataTable Variable
Example: To retrieve the first DataColumn
DataTable.Columns(0)
Note: Column index starts from 0.
Message Box Input Example
Output Example
Refer to the DataTable.Columns property (Microsoft) for more details.
2. Manipulate DataRow
2-1. Retrieve a DataRow from a DataTable Variable
Example: DataTable.Rows(0)
In this case, the following part of the above data table is retrieved:
Refer to the DataTable.Rows property (Microsoft) for more details.
2-2. Retrieve Values from a DataRow
Example: DataTable.Rows(0).Item(1)
Message Box Input Example
Output Example
Refer to the DataRow.Item property (Microsoft) for more details.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article