Information générale
Catégorie:
The Mere Mortals .NET Framework
> 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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement