Question casting String array to object

madhurim

New member
Joined
Jun 14, 2011
Messages
2
Programming Experience
Beginner
I am getting an error "unable to cast object of type 'System.Object[,]' to type 'System.String[]'" in .net. I Need help with this issue please!!
 
sample code

Private m_rgItemKeys(,) As String

Private Sub Command1_Click() Handles Command1.Click
' UPGRADE_INFO (#0501): The 'frm' member isn't used anywhere in current application.
Dim frm As New frmCasting
Call getItemkeys(m_rgItemkeys) ----- need to cast object to string array here
Me.Show()
End Sub


Private Function getItemkeys(ByRef rsValues As Object) As Boolean
On Error GoTo vberrorhandler

Redim6(rsValues, 0, 2, 0, 2 - 1)
rsValues(0, 0) = "a"
rsValues(0, 1) = "1"
rsValues(1, 0) = "b"
rsValues(1, 1) = "2"
Return True

vberrorhandler:

End Function

End Class
 
Back
Top