DataSet constraints

G

Glenn Thimmes

Hello,

I am having a problem inserting into a dataset that is loaded from a view
that does joins with other tables and includes required fields from those
tables. For example, I might have a view that is an Orders view which does a
join to a Contact table and contains the contact's last name (required
field). Now, when I do an insert, I only want to insert the information
pertaining to the Order, which is then sent back to the business object and
processed with stored procedures.

The problem is, when I create a new row, add the order information, and try
to add the row into my table, I get an error saying that column 'Last' does
not allow nulls. This is not desirable. I would like to send only necessary
information, like the ContactID, back over the wire. The workaround I have
found for this issue is to manually certain fields to allow DBNulls. This
worked out ok for writing unit tests for my business object, but it is not
an option for production code.

I guess I would like a way to fill a dataset with the table/column schema,
but without any further schema/constraints. My smart client already has a
separate 'screen' schema that defines foreign key and required field
constraints.

Thanks for any suggestions!

-Glenn
 
C

Chad Z. Hower aka Kudzu

Glenn Thimmes said:
I guess I would like a way to fill a dataset with the table/column
schema, but without any further schema/constraints. My smart client
already has a separate 'screen' schema that defines foreign key and
required field constraints.

You can temporarily disable all the constraints during population.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top