How to connect to as400 from csharp

1

Good afternoon, I need help how can i connect to as400 database db2 d from c sharp calling the data to a datatable and showing them in a datagridview? because I get pure connection information but from a console application I would appreciate your help

    
asked by Muni 15.05.2018 в 19:25
source

1 answer

0

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     
answered by 16.05.2018 / 01:19
source