Article View: borland.public.delphi.database.dotnet
Article #13Re: "Index 1 is not non-negative and below total rows count"
From: Brigitte Spatz
Date: Fri, 12 Jan 2007 06:55
Date: Fri, 12 Jan 2007 06:55
22 lines
1984 bytes
1984 bytes
Marc Rohloff [TeamB] wrote: > On Wed, 10 Jan 2007 14:49:23 +0100, Brigitte Spatz wrote: > >> bm.AddNew; //bm = BindingManager >> with dv.Item[bm.Position].Row do >> >> Inspecting shows bm.Position to be correct. What could be wrong here? > > What are the values of bm.Position and dv.Count? Immediately after bm.AddNew bm.Position is 1 and so is dv.count, but only in that one form, in all others it's 2 (or in general bm.Position + 1). > > Have you tried calling dv.AddNew instead? > Yes. I get "Object reference not set to an instance of an object" instead (in the one form, not in the others). And while there's a new entry in the grid, it doesn't have an ID, which is supposed to come from the database (an identity field) (in all forms). Brigitte
Technical Details
Message-ID:
<45a730e7@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<45a4eee5@newsgroups.borland.com> <j17ogn2nca3.dlg@dlg.marcrohloff.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 1effe6,c2e9cd633050f6c5 X-Google-Attributes: gid1effe6,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Fri, 12 Jan 2007 07:55:34 +0100 From: Brigitte Spatz <brigitteNOSPAM.spatz@svenmahn.de> Organization: Sven Mahn IT-Systementwicklungen User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 Newsgroups: borland.public.delphi.database.dotnet Subject: Re: "Index 1 is not non-negative and below total rows count" References: <45a4eee5@newsgroups.borland.com> <j17ogn2nca3.dlg@dlg.marcrohloff.com> In-Reply-To: <j17ogn2nca3.dlg@dlg.marcrohloff.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 0702-1, 11/01/2007), Outbound message X-Antivirus-Status: Clean NNTP-Posting-Host: 89.54.115.104 Message-ID: <45a730e7@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1168584935 89.54.115.104 (11 Jan 2007 22:55:35 -0800) Lines: 22 Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail