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