Using .NET to access to a IBM DB2 database

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Esqueleto

    Using .NET to access to a IBM DB2 database

    Hello

    I'm trying to connect to a IBM DB2 database with IBMDA400 Provider. I
    cannot choose the provider, this is the only one I can use.

    The tables in AS/400 don't have journal and I cannot change this.

    When I define an ODBC and link tables in ACCESS I can perform every
    actions. I change the ODBC options to commit data immediately.

    Using the same ODBC and the same insert statement, when I connect in
    my C# application using ODBCConnection, I get this error:

    ERROR [42S22] [IBM][Controlador ODBC do iSeries Access][DB2
    UDB]SQL0206 - Column N not in specified tables.

    What I want is to use a DNS Less situation, and I want to enter in the
    connection string all the parameters to connect to the AS/400
    database.
    This is my connection string:Provider =IBMDA400;Data
    Source=999.999. 999.999;

    When I put the AutoCommit option in the connection string I get this
    error:
    No error message available, result code:
    DB_E_ERRORSOCCU RRED(0x80040E21 ).

    I get this message even when the autocommit is 1, 0, true or false and
    this is the connection string: Provider=IBMDA4 00;Data
    Source=192.168. 192.12;autocomm it=0


    right now I can perform all the operation with Access database but I
    can't with my .NET application in C#.

    anyone can assist me?
    tkx in advance
    Paulo Aboim Pinto

  • Serge Rielau

    #2
    Re: Using .NET to access to a IBM DB2 database

    Esqueleto wrote:
    ERROR [42S22] [IBM][Controlador ODBC do iSeries Access][DB2
    UDB]SQL0206 - Column N not in specified tables.
    Are you submitting a query with a VARIABLE "N" in it?
    This error doesn't appear to have anything to do with your connection.
    You successfully made it to DB2 and it's SQL compiler.
    But it appears that you have to read up on how to bind variables.
    E.g. using "parameter markers".

    Cheers
    Serge

    --
    Serge Rielau
    DB2 Solutions Development
    IBM Toronto Lab

    Comment

    • Kent Milligan

      #3
      Re: Using .NET to access to a IBM DB2 database

      You might find the examples in this Redbook useful:
      Customers have been using the IBM DB2 UDB for iSeries for many years with data access technologies such as ODBC and OLE DB. The newest data access technology from Microsoft is called ADO.NET. Applications that use ADO.NET with the iSeries can work with ...


      Esqueleto wrote:
      Hello
      >
      I'm trying to connect to a IBM DB2 database with IBMDA400 Provider. I
      cannot choose the provider, this is the only one I can use.
      >
      The tables in AS/400 don't have journal and I cannot change this.
      >
      When I define an ODBC and link tables in ACCESS I can perform every
      actions. I change the ODBC options to commit data immediately.
      >
      Using the same ODBC and the same insert statement, when I connect in
      my C# application using ODBCConnection, I get this error:
      >
      ERROR [42S22] [IBM][Controlador ODBC do iSeries Access][DB2
      UDB]SQL0206 - Column N not in specified tables.
      >
      What I want is to use a DNS Less situation, and I want to enter in the
      connection string all the parameters to connect to the AS/400
      database.
      This is my connection string:Provider =IBMDA400;Data
      Source=999.999. 999.999;
      >
      When I put the AutoCommit option in the connection string I get this
      error:
      No error message available, result code:
      DB_E_ERRORSOCCU RRED(0x80040E21 ).
      >
      I get this message even when the autocommit is 1, 0, true or false and
      this is the connection string: Provider=IBMDA4 00;Data
      Source=192.168. 192.12;autocomm it=0
      >
      >
      right now I can perform all the operation with Access database but I
      can't with my .NET application in C#.
      >
      anyone can assist me?
      tkx in advance
      Paulo Aboim Pinto
      >
      --
      Kent Milligan
      ISV Enablement - System i
      kmill@us.eye-bee-m.com (spam trick) GO HAWKEYES!!
      >>ibm.com/iseries/db2
      (opinions stated are not necessarily those of my employer)

      Comment

      Working...