Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding Rows and Constraints
Message
General information
Forum:
ASP.NET
Category:
ADO.NET
Title:
Adding Rows and Constraints
Miscellaneous
Thread ID:
00819978
Message ID:
00819978
Views:
87
I've run into an issue in my business object layer after making some changes to the way I handle local data state.

My bus objects create DataRows on the client dynamically and may not post them to the server for a while. However, all data is set on the client including IDs (which are retrieved from the server via StoredProc).

My previous approach had been to create new rows, but don't add them to the datatable until save time. This worked Ok, until I needed to directly manipulate the table data directly (rare, but done on occasion). So, I thought I'll change all this to immediately add the rows to the Table.

BUT - there's a major problem and that is that I can't add the rows until I have some data in it. My bus layer has things like GetBlankRecord() which is supposed to get essentially blank items which get later filled with more data.

The problem here is that the data has constraints attached. Such as a Pk and non-nullable fields with nulls that won't allow me to add the row. I get things like Pk can't be null or Pk value not unique (if I prefill with 'empty' data).

Short of dumping the Constraints from the Table is there a way to manage this?
+++ 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?
Next
Reply
Map
View

Click here to load this message in the networking platform