Results 1 to 3 of 3

Thread: RESOLVED!! Missing fields from AS400 query

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member ARPRINCE's Avatar
    Join Date
    Mar 2003
    Location
    Pinoy in NJ
    Posts
    381

    RESOLVED!! Missing fields from AS400 query

    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:
    1. Label3.Text = TimeString   'START TIME
    2.         Dim dataCON2 As New OdbcConnection("Provider=MSDASQL;DSN=JDE;SYSTEM=XXXX;
    3.               UID=XXXX;Password=XXXX;DBQ=XXXX")
    4.         dataCON2.Open()
    5.         Dim dataCMD2 As New OdbcCommand("SELECT IMITM, IMLITM, MAITM, IMDSC1,
    6.               IMDSC2 FROM F4101 WHERE IMLITM = '" & Textbox2.Text & "'", dataCON2)
    7.  
    8.         Dim dataREADER2 As OdbcDataReader = dataCMD2.ExecuteReader(System.Data.CommandBehavior.CloseConnection)
    9.         Label4.Text = TimeString 'END TIME
    10.  
    11.         DataGrid2.DataSource = dataREADER2
    12.         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
    Last edited by ARPRINCE; Feb 19th, 2004 at 10:50 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width