Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7722199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T04:06:36+00:00 2026-06-01T04:06:36+00:00

I’m running into a strange corner-case while querying an iSeries server using ADO.NET and

  • 0

I’m running into a strange corner-case while querying an iSeries server using ADO.NET and the IBM.Data.DB2.iSeries provider that comes with Client Access.

I’m running a simple query:

SELECT col FROM table WHERE (col LIKE 'value' OR col LIKE 'value%') FETCH FIRST n ROWS ONLY

But the adapter gives an IndexOutOfRange ONLY when value is, in my case, 102. Running the same query with 101 or 103 works normally. I checked the result set by running the query directly on the iSeries, it works perfectly, and the returned rows have nothing different from what I would get running the query with another value.

Pseudo-code that runs the query is as follows:

String query = '...' // See above query

IDbDataAdapter adapter = new iDB2DataAdapter(query, connection)
DataSet ds = new DataSet()

adapter.Fill(ds) // IndexOutOfRangeException only a certain values

Sample of the data that should be returned :

1023 29134 
1023       
1023029039 

Note The blank character (and other special chars) is also found in non-failing resultsets, so I’m inclined to believe that it’s not the cause of the problem.

Stack trace of the exception

at IBM.Data.DB2.iSeries.iDB2DataReader.GetDcRow(IntPtr dataPtr, Int32 row, MpDcData[] dcData, UInt32 block)
at IBM.Data.DB2.iSeries.iDB2DataReader.GetValues(Object[] values)
at System.Data.ProviderBase.DataReaderContainer.CommonLanguageSubsetDataReader.GetValues(Object[] values)
at System.Data.ProviderBase.SchemaMapping.LoadDataRow()
at System.Data.Common.DataAdapter.FillLoadDataRow(SchemaMapping mapping)
at System.Data.Common.DataAdapter.FillFromReader(DataSet dataset, DataTable datatable, String srcTable, DataReaderContainer dataReader, Int32 startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object parentChapterValue)
at System.Data.Common.DataAdapter.Fill(DataSet dataSet, String srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords)
at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)

Update You guys were right, thanks for your help. After migrating the driver to v6r1 and installing all service packs, the problem did not go away. I ended up finding the corrupted data in my table by using the (third-party) PEEK utility, which complained about some characters being in an invalid range (less than x’40’ or equal to x’FF’). The nice part about this tool is that automagically replaces invalid characters with ‘%’, so I was able to locate the invalid data, which shows up as a blank in every other client/program (tried ODBC, STRSQL, UPDDTA).

The invalid character was actually a null char (x’00’), which the .NET driver does not seem to like.

Last update IBM support actually pointed me to this APAR (SE35276), which solves the issue.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T04:06:37+00:00Added an answer on June 1, 2026 at 4:06 am

    The more I see the problem you are running into, the more I doubt the .net driver. I pull data across from a unix based system and frequently run into issues like this when the driver gets something its not expecting. My guess is that your row #102 has some data which either doesnt fit the buffer or has a data type that the driver does not expect to see at the source. Would you have some sample data? How about trying to pull 1 column at a time to see where it fails??

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a French site that I want to parse, but am running into
I am currently running into a problem where an element is coming back from
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I am reading a book about Javascript and jQuery and using one of the
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.