原始行 [英] Original Rows

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

问题描述

我的大脑已经死了!!!!!


我修改了DataTable中的单行通过将

特定行中的FirstName列设置为另一个名字。 (没有接受更改)。


但是,这个语句仍然会返回带有''New Value in it'的行。

不应该是之前的值我做了改变或者我错过了

的东西。


r = Ds1.Tables(0).Select(Nothing,Nothing,DataViewRowState.OriginalRows)


-


OHM(特里伯恩斯)

。 。 。单手人。 。


当你不知道自己在做什么时,过得很快

解决方案

你好特里,


你知道这个页面吗?

http://msdn.microsoft.com/library/de...ClassTopic.asp


Cor


是的,我知道这个页面,但是,这是指另一种方法

,它使用DataView类来过滤输出。


当使用DataTable的.Select方法时,这似乎给出了奇怪的

结果。


试试吧,让我知道。


-


OHM(特里烧伤)

。 。 。单手人。 。


当你不知道自己在做什么时,过得很快


Cor Ligthert <无********** @ planet.nl>在消息中写道

新闻:%2 *************** @ TK2MSFTNGP11.phx.gbl ...

嗨特里,

你知道这个页面吗?

http://msdn.microsoft.com/library/de...ClassTopic.asp
Cor



select方法似乎有一个bug,但是,使用

StateFiltering的devault视图,这没问题。


Ds1.Tables(0).DefaultView.RowStateFilter = CType(ComboBox1.SelectedItem,

State).MyState


Dim i As Integer


For i = 0 To Ds1.Tables(0).DefaultView.Count - 1


txtConsole.AppendText(Ds1.Tables(0).DefaultView.It em(i)(" FirstName")&

(Microsoft.VisualBasic.vbCrLf))


下一页

-


OHM(特里伯恩斯)

。 。 。单手人。 。


当你不知道自己在做什么的时候过得很快


一个男人(OHM - 特里伯恩斯) )" < news.microsoft.com>在消息中写道

news:%2 ****************** @ TK2MSFTNGP11.phx.gbl ...

是的,我知道这个页面,但是,这是指一种不同的方法,它使用DataView类来过滤输出。

当使用DataTable的.Select方法时,这似乎给出了奇怪的结果。

尝试并让我知道。

-

OHM(特里伯恩斯) )
。 。 。单手人。 。

当你不知道自己在做什么时,过得很快

Cor Ligthert <无********** @ planet.nl>在消息中写道
新闻:%2 *************** @ TK2MSFTNGP11.phx.gbl ...

嗨特里,

你知道这个页面吗?


http://msdn.microsoft.com/library/de...ClassTopic.asp


blockquote>



My Brain is dead !!!!!

I modify a single row in a DataTable By setting the FirstName column in a
specific row to another name. ( Without Accepting Changes ).

However, this statement still returns the rows with the ''New Value in it''
shouldnt it be the values before I made the change or have I missed
something.

r = Ds1.Tables(0).Select(Nothing, Nothing, DataViewRowState.OriginalRows)

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don''t know what you''re doing

解决方案

Hi Terry,

You know this page?

http://msdn.microsoft.com/library/de...ClassTopic.asp

Cor


Yes, I''m aware of this page, however, this refers to a different method
which uses a DataView class to filter the output.

When using the .Select method of a DataTable, this appears to give strange
results.

Try it and let me know.,

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don''t know what you''re doing

"Cor Ligthert" <no**********@planet.nl> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...

Hi Terry,

You know this page?

http://msdn.microsoft.com/library/de...ClassTopic.asp
Cor



The select method seems to have a bug in it, however, using the
StateFiltering of the devault view, this works no problem.

Ds1.Tables(0).DefaultView.RowStateFilter = CType(ComboBox1.SelectedItem,
State).MyState

Dim i As Integer

For i = 0 To Ds1.Tables(0).DefaultView.Count - 1

txtConsole.AppendText(Ds1.Tables(0).DefaultView.It em(i)("FirstName") &
(Microsoft.VisualBasic.vbCrLf))

Next
--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don''t know what you''re doing

"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in message
news:%2******************@TK2MSFTNGP11.phx.gbl...

Yes, I''m aware of this page, however, this refers to a different method
which uses a DataView class to filter the output.

When using the .Select method of a DataTable, this appears to give strange
results.

Try it and let me know.,

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don''t know what you''re doing

"Cor Ligthert" <no**********@planet.nl> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...

Hi Terry,

You know this page?


http://msdn.microsoft.com/library/de...ClassTopic.asp


Cor




这篇关于原始行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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