How to send a datarow item to a function?

  • Thread starter Thread starter RSH
  • Start date Start date
R

RSH

Hi,

I have a situation where I need to send a Datarow.tiem to a function for
processing. I cant figure out the right type to specify in the function to
receive the item. What should it be?

Psuedo code...
Row.Item("EmployeeID") = GetValue(Row.Item("EmployeeID")


private function GetValue(ByVal RowItem as DataRow.Item) as boolean
...
end function

Thanks,
Ron
 
RSH said:
Hi,

I have a situation where I need to send a Datarow.tiem to a function
for processing. I cant figure out the right type to specify in the
function to receive the item. What should it be?

Psuedo code...
Row.Item("EmployeeID") = GetValue(Row.Item("EmployeeID")


private function GetValue(ByVal RowItem as DataRow.Item) as boolean
...
end function

The type of the Item property is Object, so ByVal RowItem As Object


Armin
 
Hi,

I have a situation where I need to send a Datarow.tiem to a function for
processing. I cant figure out the right type to specify in the function to
receive the item. What should it be?

Psuedo code...
Row.Item("EmployeeID") = GetValue(Row.Item("EmployeeID")

private function GetValue(ByVal RowItem as DataRow.Item) as boolean
...
end function

Thanks,
Ron

If you want this line of code to work:

Row.Item("EmployeeID") = GetValue(Row.Item("EmployeeID")


You need to return an Item (of type Object) as well


private function GetValue(byval RowItem as DataRow.Item) as Object

'change rowItem

return rowItem

end function
 
RSH,

I should use a Property instead of a Method for what you are doing. That is
in fact as it is done in a strongly typed dataset as well.

If you really want a method then combine the answers from Armin and Phillip

Cor
 
Back
Top