Hello, all, wondering if someone can tell me what I'm doing wrong here. I'm simply trying to pass a structure array to another function for some evaluation. The problem is, it hits an error when I try to pass it. I'm using VB.NET 2003. Here is my code below.


VB Code:
  1. Private Structure Fields
  2. Dim FieldName As String
  3. Dim FieldValue As String
  4. End Structure
  5. 'In declarations section
  6.  
  7. Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
  8.  
  9.  
  10. Dim ArrValidate() As Fields
  11. Dim cntrl As Control
  12. Dim X As Long
  13.  
  14. 'Fill my array
  15. For Each cntrl In Me.Controls
  16. X = X + 1
  17. ReDim Preserve ArrValidate(X)
  18. ArrValidate(X).FieldName = cntrl.Name
  19. ArrValidate(X).FieldValue = cntrl.Text
  20. Next cntrl
  21.  
  22. 'Pass the array to my function located in another class
  23. Validation.Validate_frmProducts(ArrValidate) 'Dies here
  24.  
  25. end sub

Error I get is:
Z:\HTTP\ProductMgmtApp\frmProducts.vb(576): Value of type 1-dimensional 'array of ManagementApp.frmProducts.Fields' cannot be converted to '1-dimensional array of System.Object' because 'ManagementApp.frmProducts.Fields' is not a reference type.


Anyone know what I'm doing wrong? Thanks in advance

Strick