Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ExecNonQuery Function from a Business Object
Message
De
27/06/2007 00:19:52
 
 
À
26/06/2007 14:28:23
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
01235787
Message ID:
01235912
Vues:
17
> calls a stored procedure ... message Incorrect syntax near 'OSP_Product_Additional_Information_iu'.

Try using ExecSproc() or one of the variants (eg ExecSProcScalar). ExecNonQuery is designed for executing UPDATE, DELETE, SET statements. I'm sure you could execute a stored procedure with ExecNonQuery but you'd need to specify "EXEC" as part of the command string.

As an aside (doesn't apply in your particular case), there are a number of methods in MM.NET classes which can either execute straight SQL or a stored procedure - things like FillDataSet(). I've got in the habit of always explicitly passing CommandType.StoredProcedure or CommandType.Text to such methods - it's defensive programming (because the code is not affected by the value of DefaultCommandType, and probably faster since the MM.NET overloads with omitted parameters usually pass up to the fully-specified versions anyway.

HTH, Walter
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform