🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.delphi.winforms.controls.using
Article #522

Re: Data Set Deleted Row Problem

#522
From: hu zhenghui
Date: Wed, 25 Aug 2004 13:45
84 lines
3494 bytes
Try code below:

procedure TWinForm.Button1_Click(sender: System.Object; e:
System.EventArgs);
var
  DeletedRows : Array of DataRow;
  i : Integer;
begin
  DeletedRows := DataSet1.Tables[0].Select('', '',
DataViewRowState.Deleted);
  for i := 0 to Length(DeletedRows) - 1 do
  begin
    DeletedRows[i].RejectChanges;
  end;
end;


-- 
Hu Zhenghui
IBM Certified Solutions Expert - IBM WebSphere Studio
IBM Certified Database Associate - DB2 Universal Database V8.1 Family
IBM eServer Certified Specialist - pSeries AIX System Administration
IBM Certified Database Administrator - DB2 Universal Database V8.1 for
Linux, UNIX and Windows
<New Intranet Series - Intranet DIY>                                    ISBN
7-5606-1163-X
<Flash MX Tutorial for Training>                                        ISBN
7-900107-51-7
<Introduction to Conversancy Referring Flash MX>                        ISBN
7-03-012281-X TP391.41
<Macromedia Studio MX Five In One>                                      ISBN
7-302-07057-1
<Delphi 7 Cross Platform Component Using and Writing>                   ISBN
7-113-05527-3/TP.1046
<Delphi 7 Graphics and Multimedia Advanced Component Using and Writing> ISBN
7-113-05491-9/TP.1034
<Top Sites - Business Economy Science Education>                        ISBN
7-113-05530-31
<Top Sites - Life Culture Sports entertainment>                         ISBN
7-113-05530-32
mailto:webmaster@huzhenghui.51.net
http://huzhenghui.51.net
----------------------------------------------------------------------------
----
"Stefanidis Dimitris" <distef01@yahoo.gr> д����Ϣ
news:412b5327$1@newsgroups.borland.com...
> Hello folks.
>
>
> See This :
> procedure Foo(aDataSet:DataSet);
> var
>  aRows:DataRowCollection;
> begin
>  If aDataSet.HasChanges then
>  begin
>     aRows := aDataSet.Tables[0].GetChanges.Rows;
>     For i:= 0 to Pred(aRows.Count) do
>       begin
>         If aRows.RowState = DataRowState.Deleted then
>             begin
>                // Do Something here with this row.
>
>             end;
>       end;
>  end;
>
> When i try to access the deleted row then i get an error message as :
> "DELETED ROW INFORMATION CANNOT BE ACCESSED THROUGH THE ROW "
>
> Why ????
> Any ideas how tro access the deleted row ?????
>
>
> Thanks
> Dimitris
>
>
>
>
>
>
>
>
Technical Details
Message-ID: <412c980a$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsgate.cistron.nl!news.tele.dk!news.tele.dk!small.news.tele.dk!lnewsoutpeer01.lnd.ops.eu.uu.net!lnewsinpeer01.lnd.ops.eu.uu.net!bnewsoutpeer01.bru.ops.eu.uu.net!bnewsinpeer00.bru.ops.eu.uu.net!emea.uu.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <412b5327$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 1eff29,7e3c649189ddeea6
X-Google-Attributes: gid1eff29,public
X-Google-Language: ENGLISH,ASCII
Reply-To: "hu zhenghui" <webmaster@huzhenghui.51.net>
From: "hu zhenghui" <webmaster@huzhenghui.51.net>
Newsgroups: borland.public.delphi.winforms.controls.using
References: <412b5327$1@newsgroups.borland.com>
Subject: Re: Data Set Deleted Row Problem
Date: Wed, 25 Aug 2004 21:45:31 +0800
Lines: 86
Organization: hu zhenghui
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.3790.181
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.181
NNTP-Posting-Host: 211.157.253.134
Message-ID: <412c980a$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1093441546 211.157.253.134 (25 Aug 2004 06:45:46 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsgate.cistron.nl!news.tele.dk!news.tele.dk!small.news.tele.dk!lnewsoutpeer01.lnd.ops.eu.uu.net!lnewsinpeer01.lnd.ops.eu.uu.net!bnewsoutpeer01.bru.ops.eu.uu.net!bnewsinpeer00.bru.ops.eu.uu.net!emea.uu.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail