What is a bookmark column in a database?
The MSDN documentation for SqlDataReader.GetSchemaTable method states the following for the returned ColumnOrdinal:
"The ordinal of the column. This is zero for the bookmark column of the row, if any. Other columns are numbered starting with one. This column cannot contain a null 开发者_如何学编程value."
But what does it mean by bookmark column? Is it like the primary key?
In the end, what I would like to know is if ColumnOrdinal will always be zero based or if there are scenarios when it would not be zero based.
From Bookmarks, MSDN:
Bookmarks let consumers quickly return to a row. With bookmarks, consumers can access rows randomly based on the bookmark value. The bookmark column is column 0 in the rowset. The consumer sets the dwFlag field value of the binding structure to DBCOLUMNSINFO_ISBOOKMARK to indicate that the column is used as a bookmark. The consumer also sets the rowset property DBPROP_BOOKMARKS to VARIANT_TRUE. This lets column 0 be present in the rowset. The IRowsetLocate::GetRowsAt method is then used to fetch rows, starting with the row specified as an offset from a bookmark.
精彩评论