OS/400 Db

vinnie881

Well-known member
Joined
Sep 3, 2006
Messages
152
Programming Experience
3-5
I have experience with Sql server databases, but I am confused with other types of connections. I have a client who is running
a "OS/400" db, which I think means it's a db2 Iseries on a AS400 (but I'm not certain). Can someone please provide me with a sample of how to connect and query a specifc db on this server?

Thanks a lot.
 
Last edited:
The following article provides general info though nothing .NET 2+ specific:

http://www.15seconds.com/issue/030623.htm


If you were very accustomed to using SQL Server in .NET 2 then you could make the leap of using the dataset designer to create a dataset based on SQL Server then convert it for use with DB2. It shouldnt be overly hard, but it is definitely beyond the scope of a database-in-vb.net beginner without a lot of assistance. You might have to write your own data access layer (DAL) and that will be costly. If there is no need to preserve the DB2 when your app is completed, I would migrate to oracle or SQL Server (in that order). If they have to keep it, then you'll have to charge them through the nose for the extra weeks work required to make a DAL
 
IBM.Data.DB2.ISeries

All I am looking to accomplish is return data from one simple select query into a workable format (Collecion, datatable, reader, etc). I don't see the need to write a DAL for this (it's just one query). The db2 database which resides on a AS/400 machine running os/400 seems automtically classifies the database as a Iseries Db2

Heres where I'm at:

Using the IBM.Data.DB2.ISeries, It apears that I can connect to the db2 using a simple connection string then a standard query. My issue is I need to create this blind (meaning I do not have access to the db at my location, and can not simulate the as400 running the db). In theory this should work as long I specify the correct criteria(user,pw,datasource,etc), Correct?


All the application does is return data to a datagrid then export it to excel and email. I am letting the client type/paste his query into a texbox, which then gets saved and ran as thecmd text. If they saved the text "Exec sproc_testProcedure", that shoud also in theory attempt to run the sproc_testprocedure stored procedure correct? The only reason I am wonderig is because the IBM.Data.DB2.Iseries namespace does not seem to have a way to execute procedures and add parameters.

Thanks for the help
 
Last edited:
I dont know enough about DB2 to accurately answer, and you have no way of testing my suggestions, so we are a bit stuck!?

Extrapolating from other DBs, exec might well run the stored procedure, but I cant guarantee that you will get a sensible result if it returns a cursor; normally cursors require special attention to pull data out of them. Any normal select query should be fine

As an aside, search for ExcelableDataset for an easy way to export to excel
 
Back
Top