Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
.Net and VFP AutoIncrement
Message
De
28/09/2005 10:49:17
 
 
À
28/09/2005 10:44:45
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:
01053960
Vues:
16
>Thanks, but that doesn't help me. I said that I was aware of that function but I get errors when trying to use it in .Net with an OLEDB command object.
>

Then you can only lock the table and get the max id.

>
>>>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
Répondre
Fil
Voir

Click here to load this message in the networking platform