Add the IBM.Data.DB2.iSeries dependency (with NuGet) to your project, then you can use objects such as iDB2Connection, iDB2Command, iDB2DataReader and others to perform queries. Given AS400 differs a bit from the other data bases the Connection String to use should be something like this:
Data Source=IP_o_NOMBRESISTEMA;User ID=NOMBRE_USUARIO;Password=EL_PASSWORD;Default Collection=QGPL;LibraryList=LIBRERIA1,LIBRERIA2
Note that there is an initial or main library associated with the Default Collection key, in this case with the value QGPL which is the default value, I suggest that in the if you need to access more libraries (bd schema), the comma-separated relations (,) to the LibraryList
parameter