Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Updating many-to-many link table without primary key
Message
From
07/03/2005 17:01:25
Jason Mesches
Ocean Systems Engineering Corporation
Carlsbad, California, United States
 
 
To
07/03/2005 16:49:57
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
00993430
Message ID:
00993436
Views:
11
This message has been marked as the solution to the initial question of the thread.
Hello Andrew,

As you found out, you can't use the dynamic builder unless you have a PK field defined -- .NET doesn't know how to build a "valid" WHERE clause for your UPDATE statement without the PK field and value... and thankfully, it doesn't just assume you're trying to update every record in the table!

You're going to need some way of determining how to update only the correct record in your linking table, right? How will you do that, say if you had to build the update command from scratch and run it?

That will be the key. Once you figure that out, you should then create a custom data access class (the devguide has good examples of how to do this) and have it use this command to perform the update.

Hope that helps,
---J

>Hi,
>
>I am using the mmMoverControl to combine data from a many-to-many relationship in much the same way as the mm security tables Users/Roles. The problems is that there is no primary key column in our link table (think of the MM security table UserRoles but without the primary key column) so I am getting the error
>
>"Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand that does not return any key column information."
>
>How would I do a call to SaveDataSet() to save a dataset that is based on a table without a primary key? Unfortunately our datamodel is rather frozen so we want to avoid having to add a identity column to this link table.
>
>Thank you in advance,
>
>Andrew
Previous
Reply
Map
View

Click here to load this message in the networking platform