DataView循环和编辑? [英] DataView loop and edit?

查看:63
本文介绍了DataView循环和编辑?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友


将myDataView调暗为DataView = New DataView(dsData.Tables(" tblCustomers"))

myDataView.RowFilter =" City =''London''"


我的问题是如何遍历myDataView中的所有行并编辑字段

fldZipCode so fldZipCode =" 9800"


关心Able

Dear friends

Dim myDataView as DataView = New DataView(dsData.Tables("tblCustomers"))

myDataView.RowFilter = "City = ''London''"

My question is how to loop through all rows in myDataView and edit the field
fldZipCode so fldZipCode = "9800"

Regards Able

推荐答案

嗨Able,

您可以正常方式循环任何数据视图

输入此消息观看错误

\\\

For i as Integer = 0 to myDataView.count - 1

myDataView(i)(" fldZipCode")=" 9800"

Next

///

这就是全部


我希望这有帮助吗?


Cor
Dim myDataView as DataView = New DataView(dsData.Tables(" tblCustomers"))

myDataView.RowFilter =" City =''L ondon''"

我的问题是如何遍历myDataView中的所有行并编辑
字段fldZipCode所以fldZipCode =" 9800"

关心Able
Dim myDataView as DataView = New DataView(dsData.Tables("tblCustomers"))

myDataView.RowFilter = "City = ''London''"

My question is how to loop through all rows in myDataView and edit the field fldZipCode so fldZipCode = "9800"

Regards Able



这很好

我的整数= 0到myDataView.count - 1

MsgBox(myDataView(i)(fldZipCode))

下一页


但这会导致超出范围错误

For i as Integer = 0 to myDataView.count - 1

myDataView(i)(" fldZipCode")=" 9800"

Next


问候Able

" Cor Ligthert" <无********** @ planet.nl> skrev i melding

新闻:我们************** @ TK2MSFTNGP11.phx.gbl ...
This goes fine
For i as Integer = 0 to myDataView.count - 1
MsgBox(myDataView(i)("fldZipCode"))
Next

but this causes out of range error
For i as Integer = 0 to myDataView.count - 1
myDataView(i)("fldZipCode")="9800"
Next

Regards Able
"Cor Ligthert" <no**********@planet.nl> skrev i melding
news:us**************@TK2MSFTNGP11.phx.gbl...
嗨Able,

你可以正常方式循环任何数据视图
输入此消息观看错误
\\\
我的整数= 0到myDataView.count - 1
myDataView(i)(" fldZipCode")=" 9800"
下一页
///
这就是全部

我希望这有帮助吗?

Hi Able,

You can loop though any dataview in the normal way
Typed in this message watch errors
\\\
For i as Integer = 0 to myDataView.count - 1
myDataView(i)("fldZipCode")="9800"
Next
///
That is all

I hope this helps?

Cor
Dim myDataView as DataView = New DataView(dsData.Tables(" tblCustomers"))

myDataView.RowFilter =" City =''London''"

我的问题是如何遍历myDataView中的所有行并编辑
Dim myDataView as DataView = New DataView(dsData.Tables("tblCustomers"))

myDataView.RowFilter = "City = ''London''"

My question is how to loop through all rows in myDataView and edit the


字段

fldZipCode so fldZipCode =" 9800"

关注Able
fldZipCode so fldZipCode = "9800"

Regards Able







此示例使用数据视图dv。


Dim drv As DataRowView


For each drv in dv

drv.BeginEdit()

drv.Item(" PostalCode" ;)=" 2345"

drv.EndEdit()

下一页


Ken

------------------


Able < AB ** @ epost.no>在留言中写道

news:u5 ******************* @ news4.e.nsc.no:
Hi,

This example uses a dataview dv.

Dim drv As DataRowView

For Each drv In dv
drv.BeginEdit()
drv.Item("PostalCode") = "2345"
drv.EndEdit()
Next

Ken
------------------

"Able" <ab**@epost.no> wrote in message
news:u5*******************@news4.e.nsc.no:
亲爱的朋友

Dim myDataView as DataView = New DataView(dsData.Tables(" tblCustomers"))

myDataView.RowFilter =" City =''London''" ;

我的问题是如何遍历myDataView中的所有行并编辑
字段
fldZipCode所以fldZipCode =" 9800"

关心Able
Dear friends

Dim myDataView as DataView = New DataView(dsData.Tables("tblCustomers"))

myDataView.RowFilter = "City = ''London''"

My question is how to loop through all rows in myDataView and edit the
field
fldZipCode so fldZipCode = "9800"

Regards Able




-

外发邮件已通过无病毒验证。

由AVG Anti-Virus检查( http://www.grisoft.com)

版本: 7.0.230 /病毒数据库:263.0.0 - 发布日期:2004年2月2日



--
Outgoing mail is certified Virus Free.
Checked by AVG Anti-Virus (http://www.grisoft.com).
Version: 7.0.230 / Virus Database: 263.0.0 - Release Date: 6/2/2004


这篇关于DataView循环和编辑?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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