title: How to speed up the SELECT query from AS/400 (IBM iSeries) - VB. NET Programming
body: <p>I am not a programmer, I just need very basic query to get the information from the same table (so only SELECT statement is needed to use in my program).</p>
  
  <p>I try
  <code>SELECT INFOR.PFAC , INFOR.PPAR FROM   MAINSYSTEM.INFOR INFOR WHERE ppar = '240XXX2A'</code></p>
  
  <p>but it takes like 3 mins to return the value while when I use the Data Transfer from iSeries, the speed is so quick. Is there any way I can speed up the query?</p>
  
  <p>I use <code>Driver={Client Access ODBC Driver (32-bit)}</code> to connect.</p>
  
  <p>I have a button when I press then button, it will get the data and display to a gridView</p>
  
  <pre><code>    Dim MyODBCConnection As New Odbc.OdbcConnection("Driver={Client Access ODBC Driver (32-bit)};" &amp; _
      "System=163.201.28.55 ;Default Collection=bpcshv81.PEXPLOSNA;")
  
      'Open the connection
      MyODBCConnection.Open()
      Dim Table_BOM As New DataTable
      Dim Table_BOM_Fill As New Odbc.OdbcDataAdapter("SELECT PEXPLOSNA.PFAC , PEXPLOSNA.PPAR FROM    MAINSYSTEM.INFOR  PEXPLOSNA WHERE ppar = '240XXX2A'", MyODBCConnection)
  
      Table_BOM_Fill.Fill(Table_BOM)
      DataGridView1.DataSource = Table_BOM
  </code></pre>