Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / July 2005

Tip: Looking for answers? Try searching our database.

Adding to a System.Array

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
tshad - 21 Jul 2005 02:39 GMT
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
Lucas Tam - 21 Jul 2005 02:46 GMT
"tshad" <tscheiderich@ftsolutions.com> wrote in news:evF1LUZjFHA.3012
@TK2MSFTNGP12.phx.gbl:

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

Take a look at "Redim preserve" to resize an array.

Signature

Lucas Tam (REMOVEnntp@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/

Craig Deelsnyder - 21 Jul 2005 04:11 GMT
> I am trying to add an item to a System.Array and I get an error:
>
[quoted text clipped - 20 lines]
>
> 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)....

Signature

Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET

tshad - 22 Jul 2005 07:14 GMT
> > 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), _
[quoted text clipped - 5 lines]
> >    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?
> >
[quoted text clipped - 5 lines]
> 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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.