?
Solved

SQLSTATE 22005

Posted on 2006-11-20
3
Medium Priority
?
1,893 Views
Last Modified: 2012-08-14
HI EE:

I am experiencing a wierd error SQL State 22005 when executing a DataReader and passing it one input parameter. I have checked the expected database type for this input parameter and the type specified in the parameter preparation in the .NET code. They are both the same i.e char with length 9.

However, if I input a number like 123 etc this will not raise the above exception BUT raises it for a alphabetic value like 'ab'. What is the reason this is so?

CODE:
               DB2Command cmd = new DB2Command (SQL, db2Conn);
                                                            cmd.Parameters.Add (cr.Name, DB2Type, length, cr.Name);
                                                            cmd.Parameters[0].Value = userInput;

                                                            try
                                                            {
                      DB2DataReader rs = cmd.ExecuteReader ();
                                                                  rs.Close ();
                                                            }
                                                            catch (Exception ex){throw ex; }
                                                            finally{db2Conn.Close ();}
0
Comment
Question by:LuckyLucks
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 96

Accepted Solution

by:
Bob Learned earned 2000 total points
ID: 17986529
22005 - error in assignment

Sounds like you are trying to pass in a varchar where a numeric value is expected.

Bob
0
 

Author Comment

by:LuckyLucks
ID: 17987101
No, the SYSIBM.SYSCOLUMNS shows the database field's type as a CHAR with length 9.
0
 

Author Comment

by:LuckyLucks
ID: 17987369
oops sorry, u r correct LearnedOne.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses
Course of the Month13 days, 1 hour left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question