tags:

views:

75

answers:

0

Hi , I am tring to connect AS400 iSeries database from winform application

The AS400 server is iSeriesDB2. i added IBM.DB2.ISeries.dll to reference and added and tried following code , but getting exception in first line . please let me know if i need to install any drivers or any other dll.

Dim cn As iDB2Connection = New iDB2Connection Dim cmd As iDB2Command = cn.CreateCommand() Dim dataFromTable As String cmd.CommandText = "select * from file1" cn.ConnectionString = "DataSource=xyz; Naming=System; LibraryList=" dataFromTable = CType(cmd.ExecuteScalar(), String) cn.Open() cn.Close()

Exception: An unhandled exception of type 'IBM.Data.DB2.iSeries.iDB2DCFunctionErrorException ' occurred in ibm.data.db2.iseries.dll

Additional information: Exception calling CwbDc.GetConstants from iDB2Constants constructor.