|
That is cool! We will play with that here as well to make our DB code more generic. Thanks! Jim -----Original Message----- From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Walden H. Leverich Sent: Wednesday, November 17, 2004 12:11 PM To: Midrange Systems Technical Discussion Subject: RE: Where can I get the New DB2 .NET provider? >You would need some sort of gymnastics to code the IDataReader >generically, since I believe it is set up as inherit only. OK, now you've got me wondering... Off to VS.NET... OK, that actually works! Remember, we're not creating an IDataReader, the command object is creating an iDB2DataReader, we're just holding a reference to it in an IDataReader variable, which should be valid since an iDB2DataReader implements an IDataReader interface. Actually, you can also cast up to the correct data type. I tried: Console.WriteLine(((iDB2Connection) cn).JobName); Where cn is defined as an IDbConnection type, but points to an iDB2Connection object. It worked fine. So you could use provider-specific extensions as long as your code prevented you from using Sql extensions on an iSeries connection. Cool! -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.) -- 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 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.