je la procédure stockée suivante:VB.NET procédure ou de fonction a trop d'arguments spécifiés
CREATE PROCEDURE MyProc
@posted_xml_body xml
AS
INSERT INTO MyTable
(post_datetime, post_body)
VALUES
(getdate(), @posted_xml_body)
Et le code VB suivant:
Using aConnection As New Data.SqlClient.SqlConnection(ConfigurationManager.ConnectionStrings(connectionString).ConnectionString)
aConnection.Open()
Dim aCommand As New Data.SqlClient.SqlCommand("MyProc", aConnection)
aCommand.CommandType = Data.CommandType.StoredProcedure
aCommand.Parameters.AddWithValue("@posted_xml_body", aXMLString)
Dim rows_affected As Integer = aCommand.ExecuteNonQuery()
aCommand.Dispose()
aConnection.Close()
Return rows_affected
End Using
Cependant, je continue à recevoir l'erreur suivante
"La procédure ou la fonction a trop d'arguments spécifiés."
Merci pour vos suggestions.
Où est la parenthèse finale procédure stockée (après GetDate(), XML_Body)? –
Désolé, j'ai oublié de l'inclure dans ma question mais c'est là. VALEURS (getdate(), @posted_xml_body) – mike
Ici j'utilise .ExecuteScalar pour obtenir une valeur de retour .... Je ne vois pas d'autre problème dans votre procédure. –