473,396 Members | 1,676 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to send a datarow item to a function?

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
3 2982
"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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: dudi | last post by:
I am encountering the following strange problem which causes the application to use more memory then it should. I have 5 database tables. lets pretend I want to load each one of them into a...
3
by: Phil | last post by:
Hi, I have a client/server app. that uses a windows service for the server and asp.net web pages for the client side. My server class has 3 methods that Fill, Add a new record and Update a record....
3
by: Shravan | last post by:
Hi, How can I bind DataRow array to ComboBox. I tried setting DataSource -> DataRow Array DisplayMember -> ColumnName But it was showing "System.Data.DataRow" for every item in the...
4
by: Marc van den Bogaard | last post by:
hello together, my datarow.item property is missing, i just can accesss the ItemArray property, what is wrong with this? System.Data.DataSet dataset1 = new System.Data.DataSet(); ...
4
by: Michael Carr | last post by:
I have a function that populates a class with values from a database. I'd like to pass into the function either a SqlDataReader or a DataRow, depending on which mechanism I'm using to retrieve data...
3
by: News | last post by:
Hi, I wrote a function that pulls a record, below: ++++++++++++++++++++++++++++++++++++++++ Public Function getServPlanProgActivity( serviceprogramenroll_id As Integer, activity_id As Integer )...
2
by: Ali M | last post by:
Hi, I am creating a TextBox dynamically at runtime within a Panel, and I want to bind its Text property to a DataColumn in a DataRow. What is the correct method for doing this... The following...
11
by: Tim Frawley | last post by:
I need to return a DataRow or the Row Index in a DataSet wherein the value I am attempting to find is not a primary key. I have to do this often, more than 200 times when importing a file so it...
9
by: myotheraccount | last post by:
Hello, Is there a way to convert a DataRow to a StringArray, without looping through all of the items of the DataRow? Basically, I'm trying to get the results of a query and put them into a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.