J'essaye de récupérer le résultat d'une procédure stockée lancée via ODBC mais j'obtient en retour une erreur du SGBD qui m'indique que le nombre de paramètres est incorrect au niveau du ExecuteReader()... pourtant ma procédure n'est censé recevoir qu'un seul paramètre et fonctionne parfaitement lorsque je la lance sur le serveur (call mytestproc('PAGE')).
merci pour votre aide.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 string strConnexion = "DSN=MicrosV4"; string strProcedureStockee = "mytestproc"; try { OdbcConnection oConnection = new OdbcConnection(strConnexion); OdbcCommand oCommand = new OdbcCommand(strProcedureStockee, oConnection); oCommand.CommandType = CommandType.StoredProcedure; OdbcParameter oParam = oCommand.Parameters.Add("@last_name", OdbcType.VarChar,32); oParam.Value = "PAGE"; oConnection.ConnectionString = strConnexion; oConnection.Open(); OdbcDataReader oReader = oCommand.ExecuteReader(); while (oReader.Read()) { } oReader.Close(); oConnection.Close(); }
Partager