VKinfotek Inc.
  • Us
    About Us
    Contact Us
  • FAQs
  • Ready Software
    Ready ERP ASP Core Software for Azure Cloud
    Ready Web ERP Software
    Ready ASP.Net Azure Software
    Ready C# SQL Server Accounting Software
    Ready ASP.Net MVC and EF Software
First slide
Earn $100/hour in USA! Click Here

Parameter array in vb.net

A procedure can never be called with more arguments than that specified in the procedure declaration. However, using a parameter array, we can pass an array of values for an argument of a procedure. In addition, we need not know the number of elements in the parameter array when we define the procedure. The array size can be determined individually by each call to the procedure. The 'ParamArray' keyword is used to denote a parameter array. Rules to be followed while using a Parameter Array are:

We cannot use more than one parameter array in a procedure, and it must be the last argument in the procedure definition.

  • The parameter array must be passed by value and we should specify the ByVal keyword.
  • The code within the procedure must use the parameter array as a one-dimensional array. In addition, each element of the array must be of the same data type as the data type of ParamArray.
  • The parameter array is optional. The default value of a parameter array is an empty one-dimensional array. The parameter array must be the lone optional argument in the list of arguments for a procedure. All other arguments preceding the parameter array must be as signed value.
Passing arguments of a Parameter Array

While calling a procedure, we can pass the following arguments to a parameter array: An array that has the same element type as the parameter array. The arguments are separated by commas. We can also omit the ParamArray argument. If we omit the ParamArray argument, an empty array for the parameter array will be passed to the procedure. The following example illustrates the definition of a procedure with a parameter array.


Private Sub AccOrders(ByVal AccName As String, ByVal paramArray orders() As String)
	Dim i as integer
	Msgbox(AccName & "has orders:")
	For i = 0 to UBound(orders)
		MsgBox("Orders" & i & orders(i))
	Next i
End Sub


We can make calls to the procedure AccOrders as the following.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
AccOrders("Account1","order1","order2","order3","order4","order5","order6","order7")
End Sub


Object Oriented Programming Articles
  • Abstract class constructors
  • abstract class inheritance in c#.net
  • abstract class inheritance in visual basic.net
  • New C# Language Feature: Automatic Properties
  • Calling base class constructor in C#
  • base keyword in c#
  • Compile time polymorphism - Method OverLoading
  • How to initialize Base class Object from inside Derived Class constructor
  • Constructor overloading in vb.net
  • How to use inheritance in c#
  • How to use inheritance in visual basic.net
  • Parameter array in vb.net
  • Procedure OverLoading in vb.net
  • Visual Inheritance with Windows Forms
  • Azure Platform
  • GridView CommandField example
  • GridView and DetailsView Master/Detail page using SqlDataSource control
  • POCO overview and advantages - POCO class, Entity Framework in Enterprise Applications
  • Query entity data model using linq to entities
  • Difference between arraylist and list collection
  • How to create a Web service using Visual Studio.net
  • FormView DataBound Event
  • Calling base class constructor in C#
  • Convert a sequence to a generic list using ToList()method
  • Project ideas for students
  • Accounting Software
  • Creating an ASP.Net MVC 3 application
  • Using assemblies in .net applications
  • How to implement form validation using ASP.Net 2.0 Validation Controls
  • Constructors in Visual Basic.Net
People also viewed: cover image of book develop erp software using asp core and deploy to Azure Create your own ERP Software using ASP Core>>
cover image of azure cloud book Create your own Azure SOM Software>>
cover image of asp.net book Create your own ERP Software using ASP .Net and SQL>>
cover image of foundation database programming book Create your own Accounting Software using C# >>
cover image of entity framework book Create your own SOM using Entity Framework MVC >>
Azure Q & A
Azure Platform
Grid-View
GridView CommandField example
Details-View
GridView and DetailsView Master/Detail page using SqlDataSource control
POCO
POCO overview and advantages - POCO class, Entity Framework in Enterprise Applications
Entity Framework
Query entity data model using linq to entities
Array List
Difference between arraylist and list collection
Web Services
How to create a Web service using Visual Studio.net
Form-View
FormView DataBound Event
Object Oriented Programming
Calling base class constructor in C#
Linq
Convert a sequence to a generic list using ToList()method
Project Ideas
Project ideas for students
AccountingSoftware
Accounting Software
MVC
Creating an ASP.Net MVC 3 application
.Net
Using assemblies in .net applications
ASP .Net
How to implement form validation using ASP.Net 2.0 Validation Controls
VB .Net
Constructors in Visual Basic.Net


  • SITEMAP
  • Terms of use
  • Testimonials

Back to top

Copyright © 2016 - All Rights Reserved - VKInfotek.com