Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parent/Child/Update
Message
From
10/05/2006 17:25:56
Jeff Corder
Ambit Technologies, LLC
Missouri, United States
 
 
To
All
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
Parent/Child/Update
Miscellaneous
Thread ID:
01120811
Message ID:
01120811
Views:
57
I have a table with a foreign key in my form (no problem yet). I have a generic search form which allows the user to select the row(s) they want to edit. Since there is a foreign key, I want to display the data, not the foreign key (I used a JOIN) and allow the user to make a filter selection. I am currently passing the table to the generic search form, making the selection and returning it. The problem is that when I attempt to update the data, the CommandBuilder chokes because I have use a JOIN to put the data together.

I am trying to figure out how to handle this problem without losing the functionality I have considered:

1) Set the foreign fields to ReadOnly, but the CommandBuilder wasn't paying attention and only noticed the JOIN statement, not that it wasn't supposed to save any of those columns.

2) Overload the CreateUpdateCommand() to just update the parent table (thus taking the CommandBuilder out of the loop). I can't find where to overload the method - or some other way to provide the UpdateQuery.

3) Adding the business and child objects to the search form, but since the objects keep changing, I'm not sure about how to create them generically. Also if the user selects a child comparison as a filter (i.e. "City LIKE 'D%'") that will not easily translate into a foreign key.

I appreciate any suggestions,
Jeff Corder
Next
Reply
Map
View

Click here to load this message in the networking platform