Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
.Net and VFP AutoIncrement
Message
De
28/09/2005 10:41:48
 
 
À
28/09/2005 10:04:26
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro et .NET
Versions des environnements
Visual FoxPro:
VFP 9
Database:
Visual FoxPro
Divers
Thread ID:
01053932
Message ID:
01053954
Vues:
12
>I'm writing a business object in .Net that is using a VFP database container with autoincrement primary keys. I want to send an INSERT statement using an OLEDB command and get back the value that was assigned to the auto increment field. I know about the GETAUTOINCVALUE() function that returns this value. The problem is getting the value back to my .Net class. I looked in the help file and this function is not listed in the "Supported VFP Commands" or the "Unsupported VFP Commands".
>
>When I do this with a SQL Server database I can send something like this in a single command object:
>
>
>INSERT INTO tablename (fieldlist) VALUES (valuelist)
>IF @@ROWCOUNT < 1
>  SELECT -1 AS [SCOPE_IDENTITY]
>ELSE
>  SELECT Convert(INT, SCOPE_IDENTITY()) AS [SCOPE_IDENTITY]
>
>
>How can I do something similar with VFP?
GETAUTOINCVALUE([nDataSessionNumber | 0])
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform