Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding Rows and Constraints
Message
 
To
14/08/2003 12:58:51
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
00819978
Message ID:
00820331
Views:
16
>That said, I think Stephen has the right idea for dealing with database constraints. You can get around nulls by having appropriate dummy value the the constraints can recognize and accept. I don't know a way around the unique pk issue and I am not sure you want to go there. It seems to me that if you want to get the data onto the server, that you at least want to supply the necessary key values so the records are related correctly. But then you didn't share why you need to go directly to the server data.

Part of the problem for me is that htis code is generic as it sits in the business object layer. GetBlankRow() basically retrieves a blank row and tries to add it to the Rows collection for consistency. REally in my case I don't even care about having it in the rows collection, but I do need the DataRowState to be 'Added' at that poiint. The only way I think I can do that is by addign it to the Rows collection since the property is read only.

I can hack around this with any number of tweaks, but I find none of them clean or obvious - they all would introduce some major inconsistency into the BusObject architecture where code that happens later needs to take care of making sure that hte row is added first which is my current workaround. It's messy and needs to be documented explicitly as a rule that needs to be followed if somebody overrides some basic bus object behavior (such as New()).
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Previous
Reply
Map
View

Click here to load this message in the networking platform