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
Miscellaneous
Thread ID:
00819978
Message ID:
00820471
Views:
17
DataRowCollection.Add() has an overloaded method that take Object Array as an argument. This would be the simplest way to resolve not-null constraints.

As far as PK goes, can't you fetch the next ID from SQL Server for blank record? The only problem is if you don't use it, it will be wasted.

>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?
- Jayesh
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform