Problem in passing datarow array from one sub to other 
Author Message
 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



Sat, 13 Dec 2003 23:54:42 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Help! Problem passing string array to sub

2. Bizarre problem - VB6 won't see one .EXE file but sees all others

3. pass an array as function/sub argument

4. Question on passing array parameters to VB.NET Sub/Function

5. Passing Arrays from Sub to Program

6. Passing Property Arrays to Sub Routines

7. vb5 Passing an array of type MENU to a Sub

8. How to pass array into Sub?

9. Passing Control Arrays to Sub-Procedures

10. Newbie question about passing arrays into a sub routine

11. Passing array back from Sub/Function

12. Passing control arrays to subs

 

 
Powered by phpBB® Forum Software