By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,585 Members | 2,235 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,585 IT Pros & Developers. It's quick & easy.

Using .NET to access to a IBM DB2 database

P: n/a
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_ERRORSOCCURRED(0x80040E21).

I get this message even when the autocommit is 1, 0, true or false and
this is the connection string: Provider=IBMDA400;Data
Source=192.168.192.12;autocommit=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

Sep 20 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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
Sep 20 '07 #2

P: n/a
You might find the examples in this Redbook useful:
http://www.redbooks.ibm.com/abstracts/sg246440.html

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_ERRORSOCCURRED(0x80040E21).

I get this message even when the autocommit is 1, 0, true or false and
this is the connection string: Provider=IBMDA400;Data
Source=192.168.192.12;autocommit=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
km***@us.eye-bee-m.com (spam trick) GO HAWKEYES!!
>>ibm.com/iseries/db2
(opinions stated are not necessarily those of my employer)
Sep 21 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.