Adding to a System.Array

T

tshad

I am trying to add an item to a System.Array and I get an error:

BC30456: 'add' is not a member of 'System.Array'.

My code is:

********************************************************************************************
Dim parameters As SqlParameter () = { _
New SqlParameter("@ClientID",SqldbType.VarChar,20), _
New SqlParameter("@UserID",SqldbType.BigInt) }

if session("ResumeMode") = "View" then
parameters.add(New SqlParameter("@ResumeTemplateID",SqldbType.Bigint))
else
parameters.add(New SqlParameter("@ApplicantID",SqldbType.Bigint))
end if

*******************************************************************************************

If this is not the way, how do I insert a new item in the array?

Thanks,

Tom
 
C

Craig Deelsnyder

I am trying to add an item to a System.Array and I get an error:

BC30456: 'add' is not a member of 'System.Array'.

My code is:

********************************************************************************************
Dim parameters As SqlParameter () = { _
New SqlParameter("@ClientID",SqldbType.VarChar,20), _
New SqlParameter("@UserID",SqldbType.BigInt) }

if session("ResumeMode") = "View" then
parameters.add(New SqlParameter("@ResumeTemplateID",SqldbType.Bigint))
else
parameters.add(New SqlParameter("@ApplicantID",SqldbType.Bigint))
end if

*******************************************************************************************

If this is not the way, how do I insert a new item in the array?

Thanks,

Tom

Use an ArrayList instead...just don't forget to TrimToSize() before
iterating thru the values (by default it creates buckets up to the
capacity, which is like 16 I believe by default)....
 
T

tshad

Craig Deelsnyder said:
****************************************************************************
**************** ****************************************************************************
***************

Use an ArrayList instead...just don't forget to TrimToSize() before
iterating thru the values (by default it creates buckets up to the
capacity, which is like 16 I believe by default)....

I could, but I am using it sparingly and it is already set up in my library
as a normal array. The Redim Preserve should solve my problem.

Thanks,

Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,614
Members
45,292
Latest member
EttaCasill

Latest Threads

Top