
Problem in passing datarow array from one sub to other
Hi,
I am working on a app wherein once user is logged in all the related info is
populated thro an xml. I am using datarow collection to get rows to be
filled in a combobox. Here is my code:
'--Below method is in a windows form
Private Sub LoadFloors()
Dim drwFloors() As DataRow
Dim drwFloor As DataRow
' get floor rows from settings 'gobjDSSettings is a variable of type
clsDSSettings class.
gobjDSSettings.GetFloorRows(drwFloors)
for Each drwFloor In drwFloors
cmbFloor.Items.Add(drwFloor.Item("FloorID").ToString)
Next
End Sub
'--Here is the code in clsDSSettings .GetFloorRows
Public Sub GetFloorRows(ByRef pdrwFloors() As DataRow)
'cdstSettings is a dataset poulated from an xml
pdrwFloors = cdstSettings.Tables.Item("Floor").Select(Nothing,
"FloorDisplayOrder")
End Sub
When i Execute this code I get the system.Nullreference Exception. So it
seems that passing a null refernce of object from one method to other is not
allowed in beta2.
can anyone suggest some workaround/fix to make this work.
Thanks
Ramesh