Data Types, Validation, and Enforcement in POCO DataSet
POCO DataSet intentionally does not enforce data types at the IDataRow cell level. Each cell stores values as “object?”, and assignments are not validated against column metadata at runtime. This design choice keeps the core data model lightweight, flexible, and suitable for dynamic schemas. For example:
dataRow["Age"] = "abc"; // Allowed at assignment time
Even if the column metadata declares the column as an integer type, the assignment itself succeeds.
The ColumnMetadata.DataType property is descriptive, not prescriptive. It serves as:
It is not automatically enforced by POCO DataSet core components.
The optional DataTypeNames class exists purely as a developer convenience to avoid magic strings when defining schemas. It does not imply runtime validation or database enforcement.
POCO DataSet follows a layered responsibility model:
This mirrors how most enterprise applications are structured and avoids duplicating validation logic at multiple layers.
When persisting data:
As a result:
ADO.NET’s DataRow enforces types at assignment time, which:
POCO DataSet deliberately avoids this behavior to remain:
Nothing in this design prevents adding:
These can be introduced without changing the core IDataRow behavior, preserving backward compatibility.
Table of Content POCO DataSet Concepts
Business Process Programming in .Net
© 2004–2026 Laskarzhevsky Software Inc.
Unless otherwise noted, the content of this website is licensed under the
Creative Commons Attribution 4.0 International License (CC BY 4.0).
Code examples are provided under the MIT License.
You are free to share and adapt the material provided that appropriate
credit is given and any modifications are clearly indicated.
The information provided on this website is for educational purposes only.
The author and publisher make no warranties regarding the completeness
or suitability of the information and are not responsible for any damages
resulting from its use.