By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,317 Members | 1,314 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,317 IT Pros & Developers. It's quick & easy.

How to send a datarow item to a function?

P: n/a
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
Oct 11 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"RSH" <wa*************@yahoo.comschrieb
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
Oct 11 '07 #2

P: n/a
On Oct 11, 3:10 pm, "RSH" <way_beyond_o...@yahoo.comwrote:
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

Oct 11 '07 #3

P: n/a
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

Oct 12 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.