Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Updating many-to-many link table without primary key
Message
De
07/03/2005 17:01:25
Jason Mesches
Ocean Systems Engineering Corporation
Carlsbad, Californie, États-Unis
 
 
À
07/03/2005 16:49:57
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
00993430
Message ID:
00993436
Vues:
12
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform