>According to you reply you are saying that we do not need additional
stuff.

Nothing additional other than the obvious, the Client Access .NET
driver.

>Now tell me one more thing how to specify the library and file, in the
DataAdapter...

Ah, the trouble with libraries. When the .NET driver was first released
there was no support for library lists so you had to qualify the file
names. If you want to do that you simply specify the library before the
file name, IN SQL FORMAT. That is, Lib.File, not Lib/File like you're
used to.

However, APAR SE16951 added support for Library Lists on the connection
string and the System naming convention. The System convention allows
SQL to use the library list to find a file if it's not qualified by a
name. 

So, I strongly recommend AGAINST specifying the library in the sql
statement, let the system use the library list to find it.

The code below will read a file called CUST from the library list. The
EJ user specified on the connection string has a job description that
has the correct libraries in it. Create a command line app, paste in the
code, add a reference to IBM.Data.DB2.iSeries and hit Run.

-Walden

------------
Walden H Leverich III
President & CEO
Tech Software
(516) 627-3800 x11
WaldenL@xxxxxxxxxxxxxxx
http://www.TechSoftInc.com

Quiquid latine dictum sit altum viditur.
(Whatever is said in Latin seems profound.)

----------Code-------------

using System;
using System.Data;
using IBM.Data.DB2.iSeries;
namespace iSeriesDA
{
        class Class1
        {
                [STAThread]
                static void Main(string[] args)
                {
                        iDB2Connection cn = new
iDB2Connection("DataSource=sol;userid=EJ;password=EJ;Naming=System");
                        iDB2DataAdapter da = new iDB2DataAdapter("select
* from cust", cn);
                        DataSet ds = new DataSet();
                        da.Fill(ds);
                        Console.WriteLine(ds.GetXml());
                }
        }
}
----------End Code-------------




-----Original Message-----
From: Ahmed Yusuf [mailto:ayusuf@xxxxxxxxxxxxxxxxxx] 
Sent: Tuesday, February 01, 2005 1:15 AM
To: Midrange Systems Technical Discussion
Cc: Walden H. Leverich
Subject: RE: AS/400 data connection with ADO.NET

Thanks Mr.Walden, for your detail reply, Actually I know how to you
ADO.Net for SQL and other databases, but never used data from AS/400
through ADO.NET.

According to you reply you are saying that we do not need additional
stuff.
Now tell me one more thing how to specify the library and file, in the
DataAdapter, like my library name is ABC and file name is XYZ.

Thanks once again for your reply.

Regards

Ahmed Hussain


-----Original Message-----
From: Walden H. Leverich [mailto:WaldenL@xxxxxxxxxxxxxxx]
Sent: Sunday, January 30, 2005 7:59 PM
To: Midrange Systems Technical Discussion
Subject: RE: AS/400 data connection with ADO.NET

Ahmed,

First, read my iSeries Experts Journal articles <G> (Couldn't resist)

Are you familiar with using ADO.Net to talk to any database
(SQLServer?). Talking to the iSeries isn't any different. If you're not
familiar with .NET one major difference between .NET and non-.NET is
that by default .NET wants you to use provider-specific classes. That
is, to talk to SQLServer you use SQLConnection from
System.Data.SQLServer, to talk to DB2 on iSeries you use iDB2Connection
from IBM.Data.DB2.iSeries. The advantage is that you get access to
provider-specific methods, the disadvantage is that you've bound
yourself to a data provider. You can get around this, but that's another
discussion.

Generically speaking the steps to get data are

1) Connect to iSeries
2) Create command
3) set command text = "select * from customer"
4) set datareader = command.execute()
5) while (!datareader.Read)
6) do something
7) loop (back to #5)
8) close connection

Now there are all sort of variations on that process, the most common
involving a dataset instead of a datareader and closing the connection
right after step #4. 

As I said earlier, the connection to the iSeries isn't any different
than a connection I to any other database, so stop by your favourite
book store and grab a book on using ADO.NET.

-Walden

------------
Walden H Leverich III
President & CEO
Tech Software
(516) 627-3800 x11
WaldenL@xxxxxxxxxxxxxxx
http://www.TechSoftInc.com

Quiquid latine dictum sit altum viditur.
(Whatever is said in Latin seems profound.)


-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Ahmed Yusuf
Sent: Sunday, January 30, 2005 5:45 AM
To: Midrange-L
Subject: AS/400 data connection with ADO.NET

Has any body experience of connecting with ADO.Net and AS/400 data. What
are the steps to perform AS/400 data connection with ADO.NET or
Vbasic.Net. More precisely if I want to retrieve AS/400 data through
Visual Basic.Net 

 

Any help?

 

 

Regards

 

Ahmed Hussain

 

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at http://archive.midrange.com/midrange-l.


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at http://archive.midrange.com/midrange-l.


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.