我怎样才能进入下一个记录? [英] How can i Move to the Next Record?

查看:75
本文介绍了我怎样才能进入下一个记录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你可以帮助我,我怎样才能移动到下一张唱片?


而Reader.Read

每行作为DataRow在Table.Rows

如果Reader(UserID)= Row(UserID)那么

''我需要在这里移动到下一行..

''如何移动到下一行?

否则

Dim Item作为新ListViewItem

调用Item.SubItems。添加(Reader(Name))

Call Item.SubItems.Add(Reader(" UserID"))

调用ListView1.Items.Add(Item)

结束如果

下一页

结束时


谢谢..

解决方案


你能帮助我,我怎样才能进入下一张唱片?


Whi le Reader.Read

每行作为DataRow In Table.Rows

如果Reader(UserID)= Row(UserID)那么

''我需要在这里移动到下一行..

''如何移动到下一行?

Else

Dim Item As New ListViewItem

Call Item.SubItems.Add(Reader(" Name")))

Call Item.SubItems.Add(Reader(") UserID"))

调用ListView1.Items.Add(Item)

结束如果

下一页

结束时


谢谢..



Reader.Read是一种将记录推进到下一个并返回布尔值的方法。如果预付款成功,则返回true,否则返回false。因此,Reader.Read会在循环的每次迭代中自动推进记录。如果你需要在你的循环中推进记录 - 在你需要预先的位置添加Reader.Read行。


感谢您提供信息,

我担心的是我需要将记录移动到我的表的下一行。


所以你基本上想要在For Each Row的下一次迭代中继续循环...等等等等等等。你已经有了For Each推进你的行...所以只需继续你的循环将退出到下一次迭代


展开 | 选择 | Wrap | 行号

Hi can anyone help me how can i move to the next record?

While Reader.Read
For Each Row As DataRow In Table.Rows
If Reader("UserID") = Row("UserID") Then
'' I need to Move to the next Row here..
'' How can i Move to the Next Row?
Else
Dim Item As New ListViewItem
Call Item.SubItems.Add(Reader("Name"))
Call Item.SubItems.Add(Reader("UserID"))
Call ListView1.Items.Add(Item)
End If
Next
End While

Thanks..

解决方案

Hi can anyone help me how can i move to the next record?

While Reader.Read
For Each Row As DataRow In Table.Rows
If Reader("UserID") = Row("UserID") Then
'' I need to Move to the next Row here..
'' How can i Move to the Next Row?
Else
Dim Item As New ListViewItem
Call Item.SubItems.Add(Reader("Name"))
Call Item.SubItems.Add(Reader("UserID"))
Call ListView1.Items.Add(Item)
End If
Next
End While

Thanks..

Reader.Read is a method that advances the record to the next and returns a boolean. If an advance was successful, true is returned, if not, false is returned. Consequently While Reader.Read automatically advances the record on every iteration of your loop. If you need to advance the record inside your loop - add the line Reader.Read in the position you need the advance.


Thank you for the information,
My concern is I need to move the record to the next row of my table.


So you basically want to continue your loop at the next iteration of your For Each Row...blah blah blah. You''ve already got a For Each advancing your rows...so just Continue For your loop will exit to the next iteration


Expand|Select|Wrap|Line Numbers


这篇关于我怎样才能进入下一个记录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆