Reputation: 819
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).
I try
SELECT INFOR.PFAC , INFOR.PPAR FROM MAINSYSTEM.INFOR INFOR WHERE ppar = '240XXX2A'
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?
I use Driver={Client Access ODBC Driver (32-bit)}
to connect.
I have a button when I press then button, it will get the data and display to a gridView
Dim MyODBCConnection As New Odbc.OdbcConnection("Driver={Client Access ODBC Driver (32-bit)};" & _
"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
Upvotes: 4
Views: 1427
Reputation: 4542
Part of the delay may be opening the connection.
Perhaps you can try opening it first, getting your overhead out of the way, before you even display the button.
Of course this may mean you would want to move where you close the connection too. You want to open the connection once, and close it only once when you are done.
You may want to use the .NET Data Provider supplied with iSeries Access.
Check that you are using the latest available version of iSeries Access, and make sure it has the patch installed. Your iSeries Access version can be newer than the system's OS release, but you don't want it the other way around.
Upvotes: 1