× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.




Walden,
I am not sure if you have been following this from the beginning. I was using a physical file, but it does not have any keys. So, I fell back to a logical, but it's keys are not unique. So, how would access this file in .NET?

Maurice,
I am using 3.5 Framework.
Do you have a small example of the type of code you are refering to?
Do you have a specific book that you are thinking of?
What is wrong with letting IBM .NET provider build the commands and do the updates?

You guys have alot of info, but you must remember that you too were once in my shoes and it is overwhelming most of the time. It sounds like you guys are miles ahead of me. I am an lone ranger here and I have alot of coding and managing to do. I typically find coding technics that are comfortable for me and won't take a year to write.

I appreciate the advice, but I really need to know how to get .NET to access these keyless files for now. Would I just create an SQL view with a unique key and use that?

Regards,
Duane
From: systemidotnet-request@xxxxxxxxxxxx> Subject: SystemiDotNet Digest, Vol 3, Issue 10> To: systemidotnet@xxxxxxxxxxxx> Date: Tue, 17 Feb 2009 11:18:05 -0600> > Send SystemiDotNet mailing list submissions to> systemidotnet@xxxxxxxxxxxx> > To subscribe or unsubscribe via the World Wide Web, visit> http://lists.midrange.com/mailman/listinfo/systemidotnet> or, via email, send a message with subject or body 'help' to> systemidotnet-request@xxxxxxxxxxxx> > You can reach the person managing the list at> systemidotnet-owner@xxxxxxxxxxxx> > When replying, please edit your Subject line so it is more specific> than "Re: Contents of SystemiDotNet digest..."> > > Today's Topics:> > 1. Re: System i Logical Files and .NET (Maurice O'Prey)> 2. Re: System i Logical Files and .NET (Walden H. Leverich)> 3. Re: System i Logical Files and .NET (Maurice O'Prey)> 4. Re: System i Logical Files and .NET (Walden H. Leverich)> 5. Re: Data Access Layer (John Taylor)> 6. Re: Data Access Layer (Walden H. Leverich)> > > ----------------------------------------------------------------------> > message: 1> date: Mon, 16 Feb 2009 19:34:36 -0000> from: "Maurice O'Prey" <maurice.oprey@xxxxxxxxx>> subject: Re: [SystemiDotNet] System i Logical Files and .NET> > Duane> > Which version of the .NET Framework are you using?> > Maurice> > -----Original Message-----> From: systemidotnet-bounces@xxxxxxxxxxxx> [mailto:systemidotnet-bounces@xxxxxxxxxxxx] On Behalf Of Kenneth Sanders> Sent: 16 February 2009 16:40> To: systemidotnet@xxxxxxxxxxxx> Subject: [SystemiDotNet] System i Logical Files and .NET> > > Here is some of my .NET code ( i am not a VB guru either...much to learn).> The physical file has no keys, but I am trying to use a logical built over> it.> The logical has a 3 part key (customer#, Invoice#, Invoice date).> I am using IBM .NET provider 6.1.> I am building a dataset.> > Adapter = New iDB2DataAdapter("SELECT * FROM Duane.ARTRANL1", cni5)> Dim iDB2CB As iDB2CommandBuilder = New iDB2CommandBuilder(Adapter)> Adapter.DeleteCommand = iDB2CB.GetDeleteCommand> Adapter.InsertCommand = iDB2CB.GetInsertCommand > Adapter.UpdateCommand = iDB2CB.GetUpdateCommand> > The error happens while building the Delete Command.> Here is the error:> "The table specified in the SELECT statement does not contain a unique key> or identifier column, or > the SELECT statement does not include all of the key columns."> > It looks like it doesn't like the keys from the logical. Is this because> the physical file does not have the "Unique" keyword in the DDS? These DDS> files came from the s/36 and we still have s/36 programs that use these> files daily.> So, I was going to build an identifier column in the physical file. Can't> because it is not an SQL created file.> Any ideas?> > > From: systemidotnet-request@xxxxxxxxxxxx> Subject: SystemiDotNet Digest,> Vol 3, Issue 8> To: systemidotnet@xxxxxxxxxxxx> Date: Sat, 14 Feb 2009> 12:00:02 -0600> > Send SystemiDotNet mailing list submissions to>> systemidotnet@xxxxxxxxxxxx> > To subscribe or unsubscribe via the World Wide> Web, visit> http://lists.midrange.com/mailman/listinfo/systemidotnet> or,> via email, send a message with subject or body 'help' to>> systemidotnet-request@xxxxxxxxxxxx> > You can reach the person managing the> list at> systemidotnet-owner@xxxxxxxxxxxx> > When replying, please edit your> Subject line so it is more specific> than "Re: Contents of SystemiDotNet> digest..."> > > Today's Topics:> > 1. Re: System i DDS Files (Maurice> O'Prey)> > >> ----------------------------------------------------------------------> >> message: 1> date: Fri, 13 Feb 2009 18:28:53 -0000> from: "Maurice O'Prey"> <maurice.oprey@xxxxxxxxx>> subject: Re: [SystemiDotNet] System i DDS Files>> > Walden is right> > Use SQL to update the required row, if it doesn't have> a unqiue field/key > where a=? and b=? (which it must have if it is a> relational database) then > it isn't .NET's problem.> > Avoid using the> built in (easy drag and drop to databind a table to > Gridviews etc).> >> Maurice> > > > ----- Original Message ----- > From: "Walden H. Leverich"> <WaldenL@xxxxxxxxxxxxxxx>> To: ".net use with the System i"> <systemidotnet@xxxxxxxxxxxx>> Sent: Friday, February 13, 2009 5:26 PM>> Subject: Re: [SystemiDotNet] System i DDS Files> > > > 1) Use the V6R1> driver, much better.> > 2) There must be some unique key, how will you know> what row to update?> > 3) Handle the updates yourself. The built in IO is> nice the first few> > times, then it tends to get in the way.> >> > -Walden>> >> > -- > > Walden H Leverich III> > Tech Software> > (516) 627-3800 x3051>> > WaldenL@xxxxxxxxxxxxxxx> > http://www.TechSoftInc.com> >> > Quiquid latine> dictum sit altum viditur.> > (Whatever is said in Latin seems profound.)> >>> > -- > > This is the .net use with the System i (SystemiDotNet) mailing> list> > To post a message email: SystemiDotNet@xxxxxxxxxxxx> > To subscribe,> unsubscribe, or change list options,> > visit:> http://lists.midrange.com/mailman/listinfo/systemidotnet> > or email:> SystemiDotNet-request@xxxxxxxxxxxx> > Before posting, please take a moment> to review the archives> > at http://archive.midrange.com/systemidotnet. > >> > > ------------------------------> >> _______________________________________________> SystemiDotNet mailing list>> SystemiDotNet@xxxxxxxxxxxx>> http://lists.midrange.com/mailman/listinfo/systemidotnet> > > End of> SystemiDotNet Digest, Vol 3, Issue 8>> *******************************************> _________________________________________________________________> All-in-one security and maintenance for your PC.? Get a free 90-day trial!> http://www.windowsonecare.com/purchase/trial.aspx?sc_cid=wl_wlmail> -- > This is the .net use with the System i (SystemiDotNet) mailing list> To post a message email: SystemiDotNet@xxxxxxxxxxxx> To subscribe, unsubscribe, or change list options,> visit: http://lists.midrange.com/mailman/listinfo/systemidotnet> or email: SystemiDotNet-request@xxxxxxxxxxxx> Before posting, please take a moment to review the archives> at http://archive.midrange.com/systemidotnet.> > > > ------------------------------> > message: 2> date: Mon, 16 Feb 2009 16:15:21 -0500> from: "Walden H. Leverich" <WaldenL@xxxxxxxxxxxxxxx>> subject: Re: [SystemiDotNet] System i Logical Files and .NET> > Ken,> > First, from a programming point of view, forget logicals exist. Your selects should be over the physical file. DB2 will use a logical if it makes sense, they're simply performance enhancements.> > As to your problem, you say the logical has a 3-part key, but is it unique? And if so, is it actually tagged that way in the system, or is it just that you "know" it's unique. The theory says you must have a unique key to each row in a table, now perhaps customer, invoice# and date are unique (I'd think just invoice# was unique) but you have to have told the system they're unique.> > Also, personally I'd lose the whole data adapter stuff and do your own updates, but that's just me.> > -Walden> > -- > Walden H Leverich III> Tech Software> (516) 627-3800 x3051> WaldenL@xxxxxxxxxxxxxxx> http://www.TechSoftInc.com> > Quiquid latine dictum sit altum viditur.> (Whatever is said in Latin seems profound.)> > > -----Original Message-----> From: systemidotnet-bounces@xxxxxxxxxxxx [mailto:systemidotnet-bounces@xxxxxxxxxxxx] On Behalf Of Kenneth Sanders> Sent: Monday, February 16, 2009 11:40 AM> To: systemidotnet@xxxxxxxxxxxx> Subject: [SystemiDotNet] System i Logical Files and .NET> > > Here is some of my .NET code ( i am not a VB guru either...much to learn).> The physical file has no keys, but I am trying to use a logical built over it.> The logical has a 3 part key (customer#, Invoice#, Invoice date).> I am using IBM .NET provider 6.1.> I am building a dataset.> > Adapter = New iDB2DataAdapter("SELECT * FROM Duane.ARTRANL1", cni5)> Dim iDB2CB As iDB2CommandBuilder = New iDB2CommandBuilder(Adapter)> Adapter.DeleteCommand = iDB2CB.GetDeleteCommand> Adapter.InsertCommand = iDB2CB.GetInsertCommand > Adapter.UpdateCommand = iDB2CB.GetUpdateCommand> > The error happens while building the Delete Command.> Here is the error:> "The table specified in the SELECT statement does not contain a unique key or identifier column, or > the SELECT statement does not include all of the key columns."> > It looks like it doesn't like the keys from the logical. Is this because the physical file does not have the "Unique" keyword in the DDS? These DDS files came from the s/36 and we still have s/36 programs that use these files daily.> So, I was going to build an identifier column in the physical file. Can't because it is not an SQL created file.> Any ideas?> > > From: systemidotnet-request@xxxxxxxxxxxx> Subject: SystemiDotNet Digest, Vol 3, Issue 8> To: systemidotnet@xxxxxxxxxxxx> Date: Sat, 14 Feb 2009 12:00:02 -0600> > Send SystemiDotNet mailing list submissions to> systemidotnet@xxxxxxxxxxxx> > To subscribe or unsubscribe via the World Wide Web, visit> http://lists.midrange.com/mailman/listinfo/systemidotnet> or, via email, send a message with subject or body 'help' to> systemidotnet-request@xxxxxxxxxxxx> > You can reach the person managing the list at> systemidotnet-owner@xxxxxxxxxxxx> > When replying, please edit your Subject line so it is more specific> than "Re: Contents of SystemiDotNet digest..."> > > Today's Topics:> > 1. Re: System i DDS Files (Maurice O'Prey)> > > ----------------------------------------------------------------------> > message: 1> date: Fri, 13 Feb 2009 18:28:53 -0000> from: "Maurice O'Prey" <maurice.oprey@xxxxxxxxx>> subject: Re: [SystemiDotNet] System i DDS Files> > Walden is right> > Use SQL to upd!> ate the required row, if it doesn't have a unqiue field/key > where a=? and b=? (which it must have if it is a relational database) then > it isn't .NET's problem.> > Avoid using the built in (easy drag and drop to databind a table to > Gridviews etc).> > Maurice> > > > ----- Original Message ----- > From: "Walden H. Leverich" <WaldenL@xxxxxxxxxxxxxxx>> To: ".net use with the System i" <systemidotnet@xxxxxxxxxxxx>> Sent: Friday, February 13, 2009 5:26 PM> Subject: Re: [SystemiDotNet] System i DDS Files> > > > 1) Use the V6R1 driver, much better.> > 2) There must be some unique key, how will you know what row to update?> > 3) Handle the updates yourself. The built in IO is nice the first few> > times, then it tends to get in the way.> >> > -Walden> >> > -- > > Walden H Leverich III> > Tech Software> > (516) 627-3800 x3051> > WaldenL@xxxxxxxxxxxxxxx> > http://www.TechSoftInc.com> >> > Quiquid latine dictum sit altum viditur.> > (Whatever is said in Latin seems profound.)> >> !> > -- > > This is the .net use with the System i (SystemiDotNet) mailing list> > To post a message email: SystemiDotNet@xxxxxxxxxxxx> > To subscribe, unsubscribe, or change list options,> > visit: http://lists.midrange.com/mailman/listinfo/systemidotnet> > or email: SystemiDotNet-request@xxxxxxxxxxxx> > Before posting, please take a moment to review the archives> > at http://archive.midrange.com/systemidotnet. > > > > ------------------------------> > _______________________________________________> SystemiDotNet mailing list> SystemiDotNet@xxxxxxxxxxxx> http://lists.midrange.com/mailman/listinfo/systemidotnet> > > End of SystemiDotNet Digest, Vol 3, Issue 8> *******************************************> _________________________________________________________________> All-in-one security and maintenance for your PC.? Get a free 90-day trial!> http://www.windowsonecare.com/purchase/trial.aspx?sc_cid=wl_wlmail> -- > This is the .net use with the System i (SystemiDotNet) mailing list> To post a message email: SystemiDotNet@xxxxxxxxxxxx> To subscribe, unsubscribe, or change list options,> visit: http://lists.midrange.com/mailman/listinfo/systemidotnet> or email: SystemiDotNet-request@xxxxxxxxxxxx> Before posting, please take a moment to review the archives> at http://archive.midrange.com/systemidotnet.> > > ------------------------------> > message: 3> date: Tue, 17 Feb 2009 14:39:01 +0000> from: "Maurice O'Prey" <maurice.oprey@xxxxxxxxx>> subject: Re: [SystemiDotNet] System i Logical Files and .NET> > Ken> > Since you are only returning a single result set ( even if this comes > from multiple iSeries files ) you don't need to use a dataset, a > datatable would be sufficient and more efficient> > Also I really gave up using data adapters about 2 years ago> > Try investigating the business object ( or component ) approach using > the object datasource ( detailed in most books ) and once you have a > simple working example you will be a much happier person ( it really > is a lot simpler ) IMHO> > Regards> > Maurice> > On 16 Feb 2009, at 16:39, Kenneth Sanders <duanes@xxxxxxxxxxxx> wrote:> > >> > Here is some of my .NET code ( i am not a VB guru either...much to > > learn).> > The physical file has no keys, but I am trying to use a logical > > built over it.> > The logical has a 3 part key (customer#, Invoice#, Invoice date).> > I am using IBM .NET provider 6.1.> > I am building a dataset.> >> > Adapter = New iDB2DataAdapter("SELECT * FROM Duane.ARTRANL1", cni5)> > Dim iDB2CB As iDB2CommandBuilder = New iDB2CommandBuilder(Adapter)> > Adapter.DeleteCommand = iDB2CB.GetDeleteCommand> > Adapter.InsertCommand = iDB2CB.GetInsertCommand> > Adapter.UpdateCommand = iDB2CB.GetUpdateCommand> >> > The error happens while building the Delete Command.> > Here is the error:> > "The table specified in the SELECT statement does not contain a > > unique key or identifier column, or> > the SELECT statement does not include all of the key columns."> >> > It looks like it doesn't like the keys from the logical. Is this > > because the physical file does not have the "Unique" keyword in the > > DDS? These DDS files came from the s/36 and we still have s/36 > > programs that use these files daily.> > So, I was going to build an identifier column in the physical file. > > Can't because it is not an SQL created file.> > Any ideas?> >> >> From: systemidotnet-request@xxxxxxxxxxxx> Subject: SystemiDotNet > >> Digest, Vol 3, Issue 8> To: systemidotnet@xxxxxxxxxxxx> Date: Sat, > >> 14 Feb 2009 12:00:02 -0600> > Send SystemiDotNet mailing list > >> submissions to> systemidotnet@xxxxxxxxxxxx> > To subscribe or > >> unsubscribe via the World Wide Web, visit> http://lists.midrange.com/mailman/listinfo/systemidotnet > >> > or, via email, send a message with subject or body 'help' to> systemidotnet-request@xxxxxxxxxxxx > >> > > You can reach the person managing the list at> systemidotnet-owner@xxxxxxxxxxxx > >> > > When replying, please edit your Subject line so it is more > >> specific> than "Re: Contents of SystemiDotNet digest..."> > > > >> Today's Topics:> > 1. Re: System i DDS Files (Maurice O'Prey)> > > > >> --- > >> ------------------------------------------------------------------- > >> > > message: 1> date: Fri, 13 Feb 2009 18:28:53 -0000> from: > >> "Maurice O'Prey" <maurice.oprey@xxxxxxxxx>> subject: Re: > >> [SystemiDotNet] System i DDS Files> > Walden is right> > Use SQL to > >> update the required row, if it doesn't have a unqiue field/key > > >> where a=? and b=? (which it must have if it is a relational > >> database) then > it isn't .NET's problem.> > Avoid using the built > >> in (easy drag and drop to databind a table to > Gridviews etc).> > > >> Maurice> > > > ----- Original Message ----- > From: "Walden H. > >> Leverich" <WaldenL@xxxxxxxxxxxxxxx>> To: ".net use with the System > >> i" <systemidotnet@xxxxxxxxxxxx>> Sent: Friday, February 13, 2009 > >> 5:26 PM> Subject: Re: [SystemiDotNet] System i DDS Files> > > > 1) > >> Use the V6R1 driver, much better.> > 2) There must be some unique > >> key, how will you know what row to update?> > 3) Handle the updates > >> yourself. The built in IO is nice the first few> > times, then it > >> tends to get in the way.> >> > -Walden> >> > -- > > Walden H > >> Leverich III> > Tech Software> > (516) 627-3800 x3051> > WaldenL@xxxxxxxxxxxxxxx > >> > > http://www.TechSoftInc.com> >> > Quiquid latine dictum sit > >> altum viditur.> > (Whatever is said in Latin seems profound.)> >> > > >> -- > > This is the .net use with the System i (SystemiDotNet) > >> mailing list> > To post a message email: > >> SystemiDotNet@xxxxxxxxxxxx> > To subscribe, unsubscribe, or change > >> list options,> > visit: http://lists.midrange.com/mailman/listinfo/systemidotnet > >> > > or email: SystemiDotNet-request@xxxxxxxxxxxx> > Before posting, > >> please take a moment to review the archives> > at http://archive.midrange.com/systemidotnet > >> . > > > > ------------------------------> > > >> _______________________________________________> SystemiDotNet > >> mailing list> SystemiDotNet@xxxxxxxxxxxx> http://lists.midrange.com/mailman/listinfo/systemidotnet > >> > > > End of SystemiDotNet Digest, Vol 3, Issue 8> > >> *******************************************> > _________________________________________________________________> > All-in-one security and maintenance for your PC. Get a free 90-day > > trial!> > http://www.windowsonecare.com/purchase/trial.aspx?sc_cid=wl_wlmail> > -- > > This is the .net use with the System i (SystemiDotNet) mailing list> > To post a message email: SystemiDotNet@xxxxxxxxxxxx> > To subscribe, unsubscribe, or change list options,> > visit: http://lists.midrange.com/mailman/listinfo/systemidotnet> > or email: SystemiDotNet-request@xxxxxxxxxxxx> > Before posting, please take a moment to review the archives> > at http://archive.midrange.com/systemidotnet.> > > ------------------------------> > message: 4> date: Tue, 17 Feb 2009 09:52:11 -0500> from: "Walden H. Leverich" <WaldenL@xxxxxxxxxxxxxxx>> subject: Re: [SystemiDotNet] System i Logical Files and .NET> > > Try investigating the business object ( or component ) approach using> > >the object datasource ( detailed in most books )> > Oh god yes! Once you start down the ORM (Object Relational Mapper) path> you'll never look back. Being able to do database IO code that reads> like english is such a performance improvement:> > Customer c = Customer.GetById(12345);> c.Address1 = "123 Main St";> c.Save();> > Makes a lot more sense than all the plumbing and setup code you need to> go directly to the database. Plus, you can then put processes into the> business object layer, so you could do:> > Customer c = Customer.GetById(12345);> if (c.IsOverCreditLimit())> //Disallow order> else> //Allow order> > Where IsOverCreditLimit() is a function that check 6 different tables> and performs a computation. And then you've also isolated that code into> one place to maintain and debug.> > -Walden> > -- > Walden H Leverich III> Tech Software> (516) 627-3800 x3051> WaldenL@xxxxxxxxxxxxxxx> http://www.TechSoftInc.com> > Quiquid latine dictum sit altum viditur.> (Whatever is said in Latin seems profound.)> > > ------------------------------> > message: 5> date: Tue, 17 Feb 2009 09:37:51 -0700> from: "John Taylor" <lists@xxxxxxxxxxxxxxxxxxxx>> subject: Re: [SystemiDotNet] Data Access Layer> > Hi Walden,> > > We also support a GetByExample setup so we can do simple queries:> > > > Customer example = new Customer();> > example.State = "NY";> > List<Customer> NYCustomers = Customer.GetByExample(example);> > That's an interesting idea, but am I correct to assume that this handles> only simply queries, where all of the conditions are either AND'd or OR'd as> a single expression?> > The problem I've always found with a DAL is that although it provides great> utility in a simple CRUD scenario, it starts to break down very quickly in> inquiry and reporting scenarios. You end up either creating dozens of> specialized getDataInSomeFormat() methods or creating your own query> language.> > LINQ (2 SQL) is the best idea I've seen yet to address a lot of the friction> associated with developing database applications in an OO environment.> Unfortunately, there is no provider for DB2/400, and history suggests that> it will be a long time before we see one. > > That brings be to a new question that should probably be its own thread, but> since there only appears to be about 6 people on this list, I doubt it will> a problem. The question is, does anyone else find themselves starting to use> a different database (ie: SQL Server) for new projects due to the lack of MS> tooling support by the DB2/400 group? I'm picking on them specifically> because DB2/LUW is *very* responsive to the MS tools market. It's DB2/400> that is slow to deliver, and usually provides only the bare minimum> functionality.> > > > > > ------------------------------> > message: 6> date: Tue, 17 Feb 2009 12:17:09 -0500> from: "Walden H. Leverich" <WaldenL@xxxxxxxxxxxxxxx>> subject: Re: [SystemiDotNet] Data Access Layer> > You are correct, in GetByExample() you can pass a second parm that is a> Conjunction parameter to specify AND or OR. There's also an opportunity> for the class to get involved in a callback to add additional parameters> to the query (ignore all rows marked as deleted) and we'll follow> relations set on the example object, but yes, it's targeted at simple> queries. For the more advanced ones we do exactly what you're saying, we> add GetBySomeSpecificRequirement() and> GetBySomeOtherSpecificRequirement() methods. > > The ORM base class also has a GetBySQL(), but it's protected, so only> children (other business objects) can use it. Of course, the business> object could expose a more relaxed query mechanism if it needed to.> > It's the 80/20 rule (95/5?) The simple stuff gets you 95% of the way> there, for those 5% of the time cases, you need to do more work.> > As for using other providers, much of what we're doing is off-i anyway> these days. When we have a choice, we're choosing SQLServer as we simply> find it more capable. Of course, that's only true when you don't have> RPG code that's trying to access the data too. :-)> > -Walden> > -- > Walden H Leverich III> Tech Software> (516) 627-3800 x3051> WaldenL@xxxxxxxxxxxxxxx> http://www.TechSoftInc.com> > Quiquid latine dictum sit altum viditur.> (Whatever is said in Latin seems profound.)> > > ------------------------------> > _______________________________________________> SystemiDotNet mailing list> SystemiDotNet@xxxxxxxxxxxx> http://lists.midrange.com/mailman/listinfo/systemidotnet> > > End of SystemiDotNet Digest, Vol 3, Issue 10> ********************************************
_________________________________________________________________
Express yourself with gadgets on Windows Live Spaces
http://discoverspaces.live.com?source=hmtag1&loc=us

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.