473,396 Members | 1,933 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,396 software developers and data experts.

Invalid parameter type between C# and Oracle

Hello,
I have a strange situation with something and maybe someone here can help me. I have a function in Oracle that returns a sequence number. When i try to get that value in C# by a parameter it always tells me that the parameter type is invalid. A sample value of that returned value is 115545. If indeed this error is correct then what is the correspondent in ODBCType for this value? If it isn't correct then what is the problem?

Oracle function is:
Expand|Select|Wrap|Line Numbers
  1. FUNCTION Get_Next_Message_Id__ RETURN NUMBER
  2. IS
  3.    temp_ NUMBER;
  4.    CURSOR get_in_message_id_seq IS
  5.       SELECT in_message_id_seq.NEXTVAL
  6.       FROM   dual;
  7. BEGIN
  8.    General_SYS.Init_Method(lu_name_, 'IN_MESSAGE_API', 'Get_Next_Message_Id__', TRUE);
  9.    OPEN get_in_message_id_seq;
  10.    FETCH get_in_message_id_seq INTO temp_;
  11.    CLOSE  get_in_message_id_seq;
  12.    RETURN(temp_);
  13. END Get_Next_Message_Id__;
C# Code is:
Expand|Select|Wrap|Line Numbers
  1. OdbcConnection myConnection = new OdbcConnection(ODBC_CLass.ifsconnectionstring);
  2.             OdbcParameter next_id = new OdbcParameter();
  3.             next_id.Direction = ParameterDirection.Output;
  4.             myConnection.Open();
  5.             OdbcCommand command = new OdbcCommand("{? = call ifsapp.in_message_api.Get_Next_Message_Id__}", myConnection);
  6.             command.CommandType = CommandType.StoredProcedure;
  7.             next_id = command.Parameters.Add("temp_", OdbcType.Int);
  8.             int k = command.ExecuteNonQuery();
  9.             MessageBox.Show("next_id: " + next_id.Value);
May 25 '11 #1
0 1242

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

Similar topics

2
by: Ragnar | last post by:
Hello I have a template in my kernel slab allocator, used to created object caches. template<class T, class A = void> class ObjectCache { public: explicit ObjectCache(char * name,mword...
9
by: Wally | last post by:
I am trying to display images from an Access 2000 database and I get an error "Invalid Parameter Used" when I execute the code line "picBLOB.Image = Image.FromStream(stmBLOBData)" in my Visual...
2
by: Jason Cartwright | last post by:
I have an abstract base class and two derived classes that I want to serialize and deserialize with schema validation. When I serialize instances of the derived classes the XmlSerializer adds the...
0
by: Martin | last post by:
I have Panel embedded in a Form. The panel has a PaintEventHandler to catch PaintEvents. When a PaintEvent occurs a new Thread which moves a Ellipse should be created. The Code: private void...
0
by: CroDude | last post by:
Hi all! I have problems when writting bitmap to a byte array and after reading it back form byte to Bitmap object. What I do is this: First I throw Bitmap to a memory-stream and then I write it...
3
by: halise | last post by:
Hi, i am in trouble with an exception in .net platform with c#. The exception thrown is exactly as follows: System.ArgumentException: Invalid parameter used. at...
0
by: David Veeneman | last post by:
This post is for the Google archive and does not require a reply. I received an 'Invalid parameter used' error when trying to do double-buffering with the .Net SetStyles method. I used this code...
2
by: Rubycon | last post by:
Hi all, can anybody tell me what he invalid parameter is in this code. When I try to execute the mmioDescendParent I get a returncode 11, meaning that an invalid parameter has been passed. I...
4
by: escristian | last post by:
Hello. I'm trying to create an Image so I use something like this: Image newImage = Image.FromFile(filename); Now when it's a bmp file and certain .gif files it gives me an exception that...
1
Ravi L
by: Ravi L | last post by:
I have created a windows Service which invokes executables on remote machines, waits for it to complete and then proceeds to the next machine on the network. The Account type for the windows...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.