473,386 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

How to get a c# DateTime accepted into an Oracle stored procedure

This issue has been driving me crazy. Here is my code snippet: Also see attachement
The variable:var pid = DateTime.ParseExact(e.RowData["PLAN_ISSUE_DATE"], "dd-MMM-yyyy", null);
The stored procedure parameter:cmd.Parameters.Add("P_DOC_ISSUE_DATE", OracleDbType.Date).Value = pid;
The error:PLS-00306: wrong number or types of arguments in call to

I have been surfing for 3 days trying to resolve this issue, please help! Thanks!
May 10 '12 #1
1 10628
Solution: Make sure you dba tells you that he has set a window on the date parameter so you know when you enter a value outside of that window it retuns a null value, therby making you code fail, Yikes! Communication is key.
For all others it really simple:
The variable:
var pid = DateTime.ParseExact(e.RowData["PLAN_ISSUE_DATE"], "dd-MMM-yyyy", null);

The stored procedure section:
cmd.Parameters.Add("P_DOC_ISSUE_DATE", OracleDbType.Date).Value = pid;
May 10 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Sezhman | last post by:
I am using Oracle Database, Can anyone tell me, how to connect to the oracle database and run the stored procedure in oracle. I am facing some problem in this. please guide me.. -- Sezhman
1
by: robin via SQLMonster.com | last post by:
I've tried several different way to execute a oracle stored procedure from a DTS package but to no avail. I have a Linked Server setup which does bring back Oracle tables from the server when I...
2
by: paddy_nyr | last post by:
What is the correct syntax for calling an oracle stored procedure and getting a retrun value? I created a simple procedure on my oracle database for testing and yes I know I could do this in a...
2
by: Raj | last post by:
Hi, Does anybody know how to call an oracle stored procedure ( with parameters ofcourse) from MS Access 2002. I want to invoke an oracle stored procedure which takes 2 parameters. Thanks,...
0
by: Chan | last post by:
Hi, I am trying to send set of rows from my c# web service to Oracle stored procedure. I think I can get this done using OpenXML in SQL Server. How to implement this in Oracle Stored...
1
by: Sudhish K V | last post by:
Hi all, How can i pass parameters to an oracle stored procedure from c# application? And also i need to read the return value. TIA, Sudhish.
1
by: burtonl | last post by:
I'm using the ADODB abstraction layer and trying to figure out how to call an Oracle stored procedure. It has the following types defined: CREATE OR REPLACE TYPE varchar2_3200_array IS TABLE...
1
by: zrtv | last post by:
hi All, Iam new in oracle stored procedure, i have one stored procedure and it has to be accessed from vb6. my stored procedure as follows -- employee salary will be entered by the user and...
7
by: E11esar | last post by:
Hi there. I have written a C# web service that calls an Oracle stored procedure. The SP is a simple select-max query and the table it is getting the value from has about 2.8 million rows in it. ...
3
by: rajkumarbathula | last post by:
Hi I was struck up with big problem of executing a oracle stored procedure in C#. Inputs 1:I am having 1 oracle stored procedure eg. myProc() and this procedure takes 1 INOUT parameter. of type...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.