-
Re: Array of objects?
Try read first the lenght of iRow and allocate the dimension of reuseRows
after, like:
reuseRows = new DataRow[iRow];
and so u can do the same loop to initialize each object.
Leonardo Kasperavicius
"Chris Canning" <chris.canning@centralian.nt.edu.au> escreveu na mensagem
news:3f6032a4$1@tnews.web.devx.com...
>
> G'day,
> My question is how do you initialize an array of objects (in this case
> an array of DataRow). Every approach I have tried has failed. The [] do
not
> get along well with the constructor that requires a parameter.
> Here is a paraphrase of where I'm at. This doesn't work because the array
> needs to be given a dimension to start with I think.
>
> int iRow = 0;
> DataRow[] reuseRows;
> while (queryIn.inBounds()) {
> reuseRows[iRow] = new DataRow(queryIn);
> // copy the row across
> // move to next record
> iRow++;
> }
>
> Thanking you from Alice Springs Australia.
>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks