Creating a stand alone Datarow, without the DataTable
-
I've been perplexed by this for a while now, and have found no real solution. I cannot find a way to create a stongly typed DataRow, without first creating a DataTable, which i don't want to do. Basicaly, i want to wrap my business object around a datarow, so that it can be used with a data table, without exposing the table and adapter to the external code, and using the datarow to enforce the validation initialy. Can anyone give me any pointers as to how to do this? I've tried a number of ways and been blocked by various caveats. Cheers Tris [Update] I'm thinking about using a single instance of each type of data table as a row factory, and wrap them in a static class with static members. Can anyone comment on the thread safety of this approach?
-
I've been perplexed by this for a while now, and have found no real solution. I cannot find a way to create a stongly typed DataRow, without first creating a DataTable, which i don't want to do. Basicaly, i want to wrap my business object around a datarow, so that it can be used with a data table, without exposing the table and adapter to the external code, and using the datarow to enforce the validation initialy. Can anyone give me any pointers as to how to do this? I've tried a number of ways and been blocked by various caveats. Cheers Tris [Update] I'm thinking about using a single instance of each type of data table as a row factory, and wrap them in a static class with static members. Can anyone comment on the thread safety of this approach?
hey there, have you tried System.Data.DataRow myDataRow; Riaan Booyzen