473,410 Members | 1,857 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,410 software developers and data experts.

Q: DataRowView

Hi

Suppose I have a loop such as:

For Each x As DataRowView In dataViewObj
' Some calculations go here
Next

Suppose we to access within the loop not only the current row but the next
one e.g. during the first loop x will be the first row, how can I access the
second row as well?

Thanks in advance

Geoff
Nov 20 '05 #1
2 1414
Hi Geoff,

For me you are repeating your question about the for each loop with an index
to the datarow, in my opinion the answer is the same, because of the fact
that the dv only references the datarow and the dataview.

So here as well is an for index loop needed when you want to reach your
goal.

What is it that you have against that nice for index loop?

Cor
Nov 20 '05 #2
Geoff,
In addition to the other comments:

I would use a regular For loop:

Dim dataViewObj As DataView

For index As Integer = 0 To dataViewObj.Count - 2
Dim x As DataRowView = dataViewObj(index)
Dim x1 As DataRowView = dataViewObj(index + 1)
' Some calculations go here
Next

I use Count - 2 as the last record will not have a next record.

Hope this helps
Jay

"Geoff Jones" <ge***@NODAMNSPAM.com> wrote in message
news:40***********************@news.dial.pipex.com ...
Hi

Suppose I have a loop such as:

For Each x As DataRowView In dataViewObj
' Some calculations go here
Next

Suppose we to access within the loop not only the current row but the next
one e.g. during the first loop x will be the first row, how can I access the second row as well?

Thanks in advance

Geoff

Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: John Hoge | last post by:
I have a datagrid that needs to display information from a related table, and I have use a template column to pass the Container.DataItem object to a method called ShowPub as follows: ...
1
by: VMI | last post by:
I have a field in my DataRowView that's read-only because it's a "join" of several other fields of the same DataRowView. For example, the field "Input" concatenates fields "Addr1", "City", "St",...
5
by: karim | last post by:
I am getting the error below when I try to use DataRowView in my aspx page. I am using the System.Data in my code behind. I even tried importing system.Data in the aspx. I have to qualify it with...
1
by: Guoqi Zheng | last post by:
Dear Sir, I need to access the datasource of a repeater control. I used CType(e.Item.DataItem, DataRowView), but obviously it does not work. Can some one tell me what I did wrong? See my...
7
by: Able | last post by:
Dear friends I am using FindRows methods of the DataView to select multiple rows as this: Dim custView As DataView = New DataView(custDS.Tables("Customers"), "", _ "CompanyName, ContactName",...
2
by: Frank | last post by:
Hi, I want to put a datarowview aside to use later on. How? dim curRow as datarowview dim oldRow as datarowview oldrow=currow doesn't do the trick because I save the object ref and oldrow...
2
by: Joe | last post by:
Hello All: How have you used the DataRowView. I am familiar w/ DataRow (of course!), but haven't had the need to use the DataRowView. When would you use it? Thanks. Joe
0
by: rockdale | last post by:
private void dgrid_OnItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e) { if(e.Item.ItemType ==ListItemType.Item||e.Item.ItemType ==ListItemType.AlternatingItem)...
3
by: needin4mation | last post by:
In this code: protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { DataRowView rowView =...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.