Wrox Home  
Search P2P Archive for: Go

  Return to Index  

ado_dotnet thread: IBM AS400 database connections


Message #1 by "Bob Herrmann" <bh0526@n...> on Thu, 13 Mar 2003 10:23:13 -0500
Hi,

I was wondering if anyone out there have developed ASP.Net applications
using data from IBM AS400 databases.  Up til now, I have only written apps
using SQL.  Also, I assume that stored procedures cannot be used for
databases other than SQL Server.  Is this true?

Thanks,
Bob

Message #2 by "Alex Smotritsky" <alex.smotritsky@v...> on Thu, 13 Mar 2003 16:32:36 -0500
Stored procedures can be used in all high end relational databases and
lots of low end ones as well.



-----Original Message-----
From: Bob Herrmann [mailto:bh0526@n...] 
Sent: Thursday, March 13, 2003 10:23 AM
To: ADO.NET
Subject: [ado_dotnet] IBM AS400 database connections


Hi,

I was wondering if anyone out there have developed ASP.Net applications
using data from IBM AS400 databases.  Up til now, I have only written
apps using SQL.  Also, I assume that stored procedures cannot be used
for databases other than SQL Server.  Is this true?

Thanks,
Bob


===
Fast Track ADO.NET with C# is a concise introduction to the concepts,
techniques, and libraries that you will need in order to start using
ADO.NET in your applications. The book covers DataSets and Typed
DataSets, accessing data using DataReaders and DataAdaptors, the close
relationship between ADO.NET and XML, how and where to use ADO.NET in
your enterprise applications, and how to use Web Services and ADO.NET to
easily pass data between applications.
http://www.wrox.com/books/1861007604.htm

Message #3 by "Ryan Stevens" <ryan@e...> on Sun, 23 Mar 2003 23:51:34
Hi Bob, I work at an IBM/AS400 shop developing pc applications and have 
used the IBMDA400 oledb provider with c# and vb.net to connect to DB2 for 
iSeries. To use this provider, you must use the  System.Data.OleDb
 class. You can create a connection in c# like this:

using  System.Data.OleDb;
...

OleDbConnection myConn = new OleDbConnection
     ("Provider=IBMDA400.1;Data Source=AS400NAME;" +
     "User ID=db2user;Password=db2user;Default Collection=LIBRARY");

myConn.Open();

MessageBox("Connection to: " + myConn.DataSource.ToString() + 
          " is " + myConn.State.ToString()


You might want to use a try..catch block to trap for errors like user 
id/password/connectivity issues.

From there you can pass SQL statements or use stored procs along with 
command objects to connect to your data.

I made a cool query analyzer in vb.net because I can't stand the green 
screens (really, I'm not that good at all of those keystrokes). Seriously, 
I wanted to test using ado.net with db2. Here is a link to an ado.net 
document by IBM that should help:

http://www-
919.ibm.com/servers/eserver/iseries/developer/education/wp/db2_intnet/intne
t.pdf

As far as the stored procedures, those must be developed and compiled on 
the AS400 and are often written in C among other languages.


Ryan Stevens
Gilford, NH




> Hi,

I was wondering if anyone out there have developed ASP.Net applications
using data from IBM AS400 databases.  Up til now, I have only written apps
using SQL.  Also, I assume that stored procedures cannot be used for
databases other than SQL Server.  Is this true?

Thanks,
Bob


  Return to Index