There are now two ways to access data values in a DataWindow control:
SetItem and GetItem methods access values in specific rows and columns. For example, these statements set and get the name of the employee in the Primary buffer in row 4:
dw_1.SetItemString(4, "empname", "Phillips") Dim strname As String strname = dw_1.GetItemString(4, "empname")
DataWindow data expressions use dot notation and can refer to single items, columns, blocks of data, selected data, or the whole DataWindow control. These statements are equivalent to the method calls in the previous example:
dwPrimary.PrimaryData(4, "empname") = "Phillips" Dim empinfo As Object Dim strname As String empinfo = dwPrimary.PrimaryData(4) strname = empInfo(2).ToString()
The returned empinfo Object is an array of the column values in row 4, and item 2 in the array is the employee’s name.
For more information, see “Accessing data values using DataWindow data expressions” in the chapter on using DataWindow controls in the Programmer’s Guide.