ATOUTFOX
COMMUNAUTÉ FRANCOPHONE DES PROFESSIONNELS FOXPRO
Visual FoxPro : le développement durable

Forum AtoutFox : Re: LastID   

Sujet

rss Flux RSS des derniers messages

Vous devez vous identifier pour pouvoir poser une question ou répondre.

mer. 12 janvier 2011, 11h47
Toons
atoutfox.public.association

Re: LastID

Merci thierry

on a trouvé comment lancer tout cela
voici le code pour créer la procedure stocké avec les Zero en parametre
cela ne marche pas.

Function GetLastId
return GetAutoIncValue()
EndFunc

Code en .NET proc stocké

DbCommand idCMD = this.CommandFactory("GetLastId");
idCMD.CommandType=CommandType.StoredProcedure;
cID = Convert.ToInt32(idCMD.ExecuteScalar());
return cID;


en sql
DbCommand idCMD = this.CommandFactory("SELECT "+this.PkField+" FROM
"+this.TableName+" where "+this.PkField+"=GetAutoIncValue(0)");
cID = Convert.ToInt32(idCMD.ExecuteScalar());
return cID;

cdlt
tony




Le 11/01/2011 22:29, Thierry a écrit :
> GetAutoIncValue() doit être appelé dans la même sesssion vfp que l'Insert,
> donc dans la même commande ADO.NET.
>
Permalink : http://www.atoutfox.org/nntp.asp?ID=0000004815
20 286 messages dans le forum • Liste complète des messages

www.atoutfox.org - Site de la Communauté Francophone des Professionnels FoxPro - v3.4.0 - © 2004-2026.
Cette page est générée par un composant COM+ développé en Visual FoxPro 9.0-SP2-HF3