Connect to AS400 using .NET

前端 未结 7 2151
再見小時候
再見小時候 2020-12-12 19:39

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

7条回答
  •  一向
    一向 (楼主)
    2020-12-12 19:55

    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

    • IBM.Data.DB2.iSeries.dll
    • Interop.cwbx.dll (If Data Queue used)
    • Interop.AD400.dll (If Data Queue used)

    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

    
    

    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

提交回复
热议问题