I am trying to build a .NET web application using SQL to query AS400 database. This is my first time encountering the AS400.
What do I have to install on my machine (or the AS400 server) in order to connect? (IBM iSeries Access for Windows ??)
What are the components of the connection string?
Where can I find sample codes on building the Data Access Layer using SQL commands?
Thanks.
Furthermore, the traditional IBM AS/400 system is leveraged with RPG, newer IBM AS400 host RPG applications, and some unique applications like Java. Also, it is integrated with server technology like “DB2” universal database and “Lotus Domino” software.
You need the AS400 .Net data provider. Check here: https://www-01.ibm.com/support/docview.wss?uid=isg3T1027163
For connection string samples, check here: https://www.connectionstrings.com/as-400/
Also, check out the redbook for code examples and getting started. http://www.redbooks.ibm.com/redbooks/pdfs/sg246440.pdf
Following is what I did to resolve the issue.
Installed the IBM i Access for Windows
. Not free
Referred the following dlls in the project
Data Access
using (iDB2Command command = new iDB2Command()) { command.Connection = (iDB2Connection)_connection; command.CommandType = CommandType.Text; command.Parameters.AddWithValue(Constants.ParamInterfaceTransactionNo, 1); command.CommandText = dynamicInsertString; command.ExecuteScalar(); }
Connection String
<add name="InterfaceConnection" connectionString="Data Source=myserver.mycompany.com;User ID=idbname;Password=mypassxxx; Default Collection=ASIPTA;Naming=System"/>
UPDATE
i Access for Windows on operating systems beyond Windows 8.1 may not be supported. Try the replacement product IBM i Access Client Solutions
IBM i Access Client Solutions
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With