date from c# to oracle

M

manlio

come posso passare con C# un argomento di tipo data a una stored
procedure di oracle?
Io ho provato con:


how can I pass a date from c# to an oracle stored procedure?
I tried with:


DateTime myDate;
myDate=DateTime.Today;

//creo il comando SQL da eseguire
OracleCommand cmd = Conn.CreateCommand();
cmd.CommandText = sStepProcedureName;
cmd.CommandType = CommandType.StoredProcedure;

//lista dei parametri (tipi)
cmd.Parameters.Add(new OracleParameter("inDATA_ULT_AGGIORN",
OracleType.DateTime ));

cmd.Parameters["inDATA_ULT_AGGIORN"].Direction =
ParameterDirection.Input;
cmd.Parameters["inDATA_ULT_AGGIORN"].Value =myDate;
..............
myDataReader = cmd.ExecuteReader();

Ma ottengo il seguante errore:
But I get:

ORA-06550: line 1, column 7: PLS-00306: wrong number or types of
arguments in call to 'INSERTDOSSIER' ORA-06550: line 1, column 7:
PL/SQL: Statement ignored

Can anyone help me?
 
G

Guest

Hi manlio,

How you are passing the date to the stored procedure looks fine to me. This
leads me to believe that there is a different problem with the code. I
cannot tell from the small snippet that you have posted though. My first
suggestion would be to look and see if you are passing the procedure all of
the parameters that it requires and that the parameter names are all spelled
correctly. If you do not see the problem doing this try writing a sample app
with one parameter being passed to a stored proc that takes only one
parameter and then step by step building up to what you have now.

I hope this helps.
---------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top