mer. 12 janvier 2011, 12h00
Thierry
atoutfox.public.association
Re: LastID
OleDbConnection sC = new OleDbConnection("Provider=VFPOLEDB.1;Data
Source=...");
sC.Open();
OleDbCommand command = new OleDbCommand("sp_test(?)", sC);
command.Parameters.Add("@param1", OleDbType.VarChar, 5);
command.Parameters[0].Value = "ABCDE";
command.Parameters.Add("@retval", OleDbType.Integer).Direction =
ParameterDirection.ReturnValue;
command.ExecuteNonQuery();
Console.WriteLine(command.Parameters["@retval"].Value);
La procédure stockée SP_TEST :
PARAMETERS tValeur1
INSERT INTO ... VALUE (m.tVAleur1)
RETURN GetAutoIncValue()
--
Thierry
"Toons" <"tony["@]planitron[.]com> a écrit dans le message de news:
igjs56$192e$1@news.niouzes.net...
> Bonjour Thierry,
>
> Ok c'est compris, aurais tu la syntaxe pour lancer une Procedure Stockée
> en commande sql en ado.net.
>
> 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=0000004816