Article View: borland.public.csharpbuilder.language.csharp
Article #23Re: Iterate through a dataset
From: Andre
Date: Fri, 05 May 2006 20:21
Date: Fri, 05 May 2006 20:21
27 lines
1813 bytes
1813 bytes
Use .NET's Arraylist class as your array to store rows/fields that you
retrieved from the dataset table.
Arraylist ar = new Arraylist();
foreach DataRow r in DataSet1.Tables["yourTableName"].Rows
{
string fieldValue = (string)r["fieldname"];
ar.add(fieldValue);
}
"Les" <les.haagensen@saint-gobain.com> wrote in message
news:444522d8$1@newsgroups.borland.com...
>
> Hi,
> Im just getting started with c#. Can someone tell me how to do this Delphi
> example in c# please. Thanks in advance.
>
> With clientdataset do
> begin
> first;
> while not eof do
> begin
> //populate array with a field value
> end;
> end;
Technical Details
Message-ID:
<445bb3b1$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news4.google.com!news.glorb.com!news2.euro.net!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<444522d8$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 1efe35,ac9159a6bb04a994 X-Google-Attributes: gid1efe35,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Andre" <andretruter@webmail.co.za> Newsgroups: borland.public.csharpbuilder.language.csharp References: <444522d8$1@newsgroups.borland.com> Subject: Re: Iterate through a dataset Date: Fri, 5 May 2006 22:21:03 +0200 Lines: 29 Organization: Bluewater Systems X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original X-Antivirus: avast! (VPS 0618-3, 05/05/2006), Outbound message X-Antivirus-Status: Clean NNTP-Posting-Host: 196.207.45.253 Message-ID: <445bb3b1$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1146860465 196.207.45.253 (5 May 2006 13:21:05 -0700) Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news4.google.com!news.glorb.com!news2.euro.net!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail