I am testing how long to make an info lookup for account numbers, item#s, etc. to our AS400. Below is a part of my code:
VB Code:
Label3.Text = TimeString 'START TIME Dim dataCON2 As New OdbcConnection("Provider=MSDASQL;DSN=JDE;SYSTEM=XXXX; UID=XXXX;Password=XXXX;DBQ=XXXX") dataCON2.Open() Dim dataCMD2 As New OdbcCommand("SELECT IMITM, IMLITM, MAITM, IMDSC1, IMDSC2 FROM F4101 WHERE IMLITM = '" & Textbox2.Text & "'", dataCON2) Dim dataREADER2 As OdbcDataReader = dataCMD2.ExecuteReader(System.Data.CommandBehavior.CloseConnection) Label4.Text = TimeString 'END TIME DataGrid2.DataSource = dataREADER2 DataGrid2.DataBind()
When I run the query with a valid item# entered into TEXTBOX2 , I get the correct record back but I always lose the fields IMLITM and IMAITM. What I can't figure is the sample query is based on a condition where IMLITM = TEXTBOX2 and yet, this field is left out when displayed on the datatgrid.
When I debug the datareader to show me what's the value of my field, I get this for IMLITM and IMAITM:
_____________
?datareader2.GetValue(1)
{System.Array}
(0): 247
(1): 240.... until .... (24): 64
_____________
It's coming out as an array when it has a character type definition in AS400. Anyone has an idea why this is so?
Thanks




Reply With Quote