Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Your thoughts please
Message
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Versions des environnements
Environment:
C# 1.1
Database:
MS SQL Server
Divers
Thread ID:
01075336
Message ID:
01075432
Vues:
13
Hi, Einar,

I use a stored proc, but I do it all in one round trip. Let's say I have a stored proc for adding/updating a simple name table.

I'll pass the values as parms.....@NamePK int = null, @FirstName, @LastName

If the @NamePK was not passed ("insert mode"), I'll issue an insert statement, and then do a scope_identity to get the value of the PK that was assigned.

IF the @NamePK was passed, I'll issue an update statement based on the @NamePK.

Hope that helps...
Kevin
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform