Bonjour à tous,
j'ai épluché la FAQ, les articles et les sources sans succès.
Je m'adresse donc à vous pour le problème suivant :
Environnement
C#-VS2008-Oracle 10g-ODP.NET
J'aimerais connaitre la syntaxe correcte à employer dans le bout de code suivant pour appeler une procédure stockée résidant dans ma DB Oracle et nécéssitant le passage d'un paramètre en entrée de type varchar !

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
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
 
public static bool Test_SP()
{
            DbConnection dbConn ;
            DbProviderFactory dbpf;
            string sConnectionString;
 
            dbpf = DbProviderFactories.GetFactory("Oracle.DataAccess.Client"); //Client Oracle
            dbConn = dbpf.CreateConnection();
            dbConn.ConnectionString = "User ID=" + ConfigurationSettings.AppSettings["UserID"].ToString() + "; Password=" + ConfigurationSettings.AppSettings["Password"].ToString() + ";Data Source=" + ConfigurationSettings.AppSettings["DataSource"].ToString();
            try
            {
                dbConn.Open();
            }
            catch (Exception e)
            {
                Sys.Alert("Unable to connect to the database!" + Sys.CR + "Please check your network connection or Oracle service." + Sys.CR + Sys.CR +
                              "Error message : " + Sys.CR + "--------------- " + Sys.CR + e.Message);
                return false;
            }
 
            try
            {
                DbCommand oCmd = dbConn.CreateCommand();
                DbParameter ocParam = oCmd.CreateParameter();
 
                oCmd.CommandType = CommandType.StoredProcedure;
                oCmd.CommandText = "DUMP_SEASON_TO_CSV";
 
                ocParam.Direction = ParameterDirection.Input;
                ocParam.Value = "W10";
 
                object result = oCmd.ExecuteNonQuery();
            }
            catch (Exception e)
            {
                Sys.Alert("Error message : " + Sys.CR + "--------------- " + Sys.CR + e.Message);
                return false;
            }
            return true;           
}
A la question pourquoi ne pas avoir utilisé directement le client Oracle:
Mon collègue a travaillé ainsi dans un souci de portabilité vers d'autres DB.

Déjà merci pour vos réponses.

Yndigos