5.10. DataSets and Nonrelational Data Types Revisited

In Chapter 4, you learned about using nonrelational data types, such as Object, with DataSet. There I note that DataColumn supports only a certain subset of data types. Object is not among them, although you can define and use a DataColumn of type Object (or Person) with only minor difficulties. In this chapter you've started using DataSet with nonrelational types by virtue of using SqlDataAdapter, which supports SQL Server's SQL_VARIANT type. The data type mappings in Appendix A map this data type to the CLR type Object.

The SQL_VARIANT data type was added to SQL Server to support the use of OLE DB providers such as the Exchange OLE DB Provider, which exposes heterogeneous hierarchies and ...

Get Essential ADO.NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.