Hi All!
##### I have a class clsQProductItem with function GetAllFromInvoi ce:
Friend Function GetAllFromInvoi ce(ByVal Invoice As String) As
clsQProductItem ()
' Dim retObject() As clsQProductItem = New
clsQProductItem
Dim DataConn As New DataConn
Dim DT As New DataTable
Dim iRowNum As Integer
'Step1: Get all productItems belonging to Invoice
Try
DT = DataConn.RunCmd ("Select * from '" & TableName & "'
where invoice = '" & Invoice & "'")
Dim retObject(DT.Ro ws.Count) As clsQProductItem
'retObject = New clsQProductItem
While Not (DT.Rows(iRowNu m).HasErrors)
With retObject(iRowN um)
.ProductItemID =
DT.Rows(iRowNum ).Item("Product ItemID").ToStri ng
.Product =
DT.Rows(iRowNum ).Item("Product ").ToString
.Invoice = Invoice
.Quantity =
DT.Rows(iRowNum ).Item("Quantit y").ToString
End With
iRowNum += 1
End While
Return retObject
Catch ex As Exception
EventLog1.Write Entry("Error in cls" & TableName &
".GetAllFromInv oice: " & ex.Message)
End Try
End Function
###### Trying to call this function from a Form:
Dim QProd() As clsQProductItem = New clsQProductItem () {}
QProd = DirectCast(QPro d.GetAllFromInv oice(CurrentQin voice),
clsQProductItem ())
###### I get a squiggly line with message 'GetAllFromInvo ice' is not a
member of 'System.Array'
###### Tried this also, gives same error
Dim QProd() As clsQProductItem = New clsQProductItem () {}
QProd = QProd.GetAllFro mInvoice(Curren tQinvoice)