× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



What you deduced makes sense. One thing that's not clear is if you've
hardcoded the columns being returned or just let the DataGridView
dynamically create them (usual case). If you've hardcoded the columns, you
ought to be able to change them then.

If it is dynamic and it's the issue with the DataGridView misinterpreting
the data type (shouldn't do that, but...), perhaps you can change your SQL
SELECT statement to explicitly cast that column to character (i.e.
CHAR(myColumn)).

I wish I knew more about .net to give you some .net type options but I'm
still learning as well.

HTH, Elvis

Celebrating 11-Years of SQL Performance Excellence on IBM i, i5/OS and
OS/400
www.centerfieldtechnology.com

-----Original Message-----
Subject: [SystemiDotNet] DataGridView field error

I have a small test app that I've been playing with, learning how to
connect and pull data from my i5. Good news is I got it working
perfectly. Bad news is I changed the input file and now it's not
working.

The file that I have changed to is a JD Edwards file that has the
Business Unit field in it. This is a very common field in JDE, and a
little strange. It's a 12 digit character field, but almost always has
a right-justified numeric value in it.

I am including this field in my grid, along with the Item number and
Quantity on hand. When the grid loads, I see a red 'X' for the Business
Unit and I get the following error:

System.Windows.Forms.DataGridViewCell.GetFormattedValue(Object value,
Int32 rowIndex, DataGridViewCellStyle& cellStyle, TypeConverter
valueTypeConverter, TypeConverter formattedValueTypeConverter,
DataGridViewDataErrorContexts context)

I have no idea what this means, but I assume it means that VB is
assuming that this field is numeric, but then crashing when it finds
there is non-numeric data in the field (blanks). The other two fields
show up fine.

How do I resolve this error? Is there a specific property I need to set
on the column to force a character data type?

Thanks

Bob Cagle


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.