Article View: borland.public.delphi.aspdotnet.components.using
Article #256Re: Inserting record in Detail dbwebgrid.
From: Vagelis
Date: Thu, 24 Mar 2005 10:58
Date: Thu, 24 Mar 2005 10:58
67 lines
4093 bytes
4093 bytes
"John Moshakis" <john@moshakis.com> wrote in message news:424237c1@newsgroups.borland.com... > Vagelis wrote: > > > > > > > > > I mean that the error occurs when I press the "Insert" button of the > > second dbWebNavigator.I get the error message: "Internal Error in > > Module DBWebGrid2.Invalid CurrentPageIndex value. It must be >= 0 and > > < the PageCount." and no row is added to DBWebGrid2. DBWebGrid2 is > > not even rendered on the page. Instead of DBWebGrid2 I get the > > beautiful error message on my page. Could this probably mean that the > > problem has to do with rendering of the 2nd dbWebGrid? Or maybe > > something before the rendering takes place? I'm not experienced > > enough to judge. But it looks as if the PageCount value of DBWebGrid2 > > is estimated according to the pages needed for the specific record of > > the master table. So when a new record with no specified foreign key > > is added in the end of the detail table, PageCount property is > > exceeded. I would like to catch the exception and check the PageCount > > value right before the error occurs.Should I implement the OnClick > > event of DBWebNavigator2? And if this is the actual problem how could > > I change the PageCount property? > > > > Thanks for your interest John. > > > > Vag > > The onclick of the dbwebnavigator wouldn't be fired when you press the > buttons. I've never seen the error your getting. What database are you > using ? You could post an example in the attachments group and I'll > have a look at it. > > Cheers, > John > I'm using MsAccess 97 files to populate my Grids. But I just came through a paragraph in the .NET Framework Developer's guide which made me feel quite silly: " Unrelated Tables Only The automatic command generation logic generates INSERT, UPDATE, or DELETE statements for standalone tables without taking into account any relationships to other tables at the data source. As a result you may encounter a failure when calling Update to submit changes for a column that participates in a foreign key constraint in the database. To avoid this exception, do not use the CommandBuilder for updating columns involved in a foreign key constraint and instead, explicitly specify the statements used to perform the operation. " And since CommandBuilder populated my first table easily and efficiently, when I added the relation and the second table, it never occured to me that I would have problems. I will try to create my commands without the use of the CommandBuilder, before wasting more of your time John. I suppose that the reason of the error MUST be the Insert command generated by the command builder. If this doesn't work either, I'll post in the attachments group. Thanks a lot, Vag ps "The onclick of the dbwebnavigator wouldn't be fired when you press the buttons"???Why? Isn't it supposed to do exactly this thing?
Technical Details
Message-ID:
<424299b4@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newsread.com!news-xfer.newsread.com!nntp.abs.net!news.maxwell.syr.edu!news-out.nntp.be!propagator2-sterling.newsfeeds.com!news-in.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<423ab985@newsgroups.borland.com> <423b32b6$2@newsgroups.borland.com> <423ea01f@newsgroups.borland.com> <423f96c1@newsgroups.borland.com> <423fdbd8@newsgroups.borland.com> <424237c1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 21665a,6c294b2d21e85c9b X-Google-Attributes: gid21665a,public X-Google-Language: ENGLISH,ASCII-7-bit Reply-To: "Vagelis" <vagelis@4m.gr> From: "Vagelis" <vagelis@4m.gr> Newsgroups: borland.public.delphi.aspdotnet.components.using References: <423ab985@newsgroups.borland.com> <423b32b6$2@newsgroups.borland.com> <423ea01f@newsgroups.borland.com> <423f96c1@newsgroups.borland.com> <423fdbd8@newsgroups.borland.com> <424237c1@newsgroups.borland.com> Subject: Re: Inserting record in Detail dbwebgrid. Date: Thu, 24 Mar 2005 12:58:45 +0200 Lines: 69 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 195.97.18.91 Message-ID: <424299b4@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1111660980 195.97.18.91 (24 Mar 2005 02:43:00 -0800) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newsread.com!news-xfer.newsread.com!nntp.abs.net!news.maxwell.syr.edu!news-out.nntp.be!propagator2-sterling.newsfeeds.com!news-in.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail