You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/data/oledb/accessing-xml-data.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,21 +25,21 @@ There are two separate methods of retrieving XML data from a data source: one us
25
25
## Retrieving XML Data Using CStreamRowset
26
26
You specify [CStreamRowset](../../data/oledb/cstreamrowset-class.md) as the rowset type in your `CCommand` or `CTable` declaration. You can use it with your own accessor or no accessor, for example:
Normally when you call `CCommand::Open` (specifying, for example, `CRowset` as the `TRowset` class), it obtains an `IRowset` pointer. `ICommand::Execute` returns an `IRowset` pointer, which is stored in the `m_spRowset` member of the `CRowset` object. Methods such as `MoveFirst`, `MoveNext`, and `GetData` use that pointer to retrieve the data.
39
39
40
40
By contrast, when you call `CCommand::Open` (but specify `CStreamRowset` as the `TRowset` class), `ICommand::Execute` returns an `ISequentialStream` pointer, which is stored in the `m_spStream` data member of [CStreamRowset](../../data/oledb/cstreamrowset-class.md). You then use the `Read` method to retrieve the (Unicode string) data in XML format. For example:
41
41
42
-
```
42
+
```cpp
43
43
myCmd.m_spStream->Read()
44
44
```
45
45
@@ -55,13 +55,13 @@ myCmd.m_spStream->Read()
55
55
56
56
Use `CXMLAccessor` as you would any other accessor class, passing it as a template parameter to `CCommand` or `CTable`:
57
57
58
-
```
58
+
```cpp
59
59
CTable<CXMLAccessor, CRowset> rs;
60
60
```
61
61
62
62
Use [GetXMLRowData](../../data/oledb/cxmlaccessor-getxmlrowdata.md) to retrieve data from the table one row at a time, and navigate rows using methods such as `MoveNext`, for example:
@@ -104,24 +96,24 @@ Gets column information from the opened rowset.
104
96
### Syntax
105
97
106
98
```cpp
107
-
HRESULT GetColumnInfo(DBORDINAL* pulColumns,
108
-
DBCOLUMNINFO** ppColumnInfo,
109
-
LPOLESTR* ppStrings) const;
110
-
111
-
HRESULT GetColumnInfo(DBORDINAL* pColumns,
99
+
HRESULT GetColumnInfo(DBORDINAL* pulColumns,
100
+
DBCOLUMNINFO** ppColumnInfo,
101
+
LPOLESTR* ppStrings) const;
102
+
103
+
HRESULT GetColumnInfo(DBORDINAL* pColumns,
112
104
DBCOLUMNINFO** ppColumnInfo);
113
105
```
114
106
115
107
#### Parameters
116
-
See [IColumnsInfo::GetColumnInfo](https://msdn.microsoft.com/en-us/library/ms722704.aspx) in the *OLE DB Programmer's Reference*.
108
+
See [IColumnsInfo::GetColumnInfo](https://msdn.microsoft.com/library/ms722704.aspx) in the *OLE DB Programmer's Reference*.
117
109
118
110
### Return Value
119
111
A standard HRESULT.
120
112
121
113
### Remarks
122
114
The user must free the returned column information and string buffer. Use the second version of this method when you use [CDynamicAccessor](../../data/oledb/cdynamicaccessor-class.md) and need to override the bindings.
123
115
124
-
For more information, see [IColumnsInfo::GetColumnInfo](https://msdn.microsoft.com/en-us/library/ms722704.aspx) in the *OLE DB Programmer's Reference*.
116
+
For more information, see [IColumnsInfo::GetColumnInfo](https://msdn.microsoft.com/library/ms722704.aspx) in the *OLE DB Programmer's Reference*.
125
117
126
118
## See Also
127
119
[OLE DB Consumer Templates](../../data/oledb/ole-db-consumer-templates-cpp.md)
0 commit comments