填写数据集 [英] Filling a Dataset

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

问题描述

我有数据集,我需要过滤到另一个数据集进行显示,而我不知道如何执行此操作。我找到了复制数据集的方法

但是我看不到如何过滤使用我的查询复制的行。


我希望能够使用一个DataAdaptor来执行此操作,但SelectCommand

需要连接,我不知道如何创建与我的

数据集对象的连接。

任何指针都会非常感激。

Sid。


(VB.NET 2003)

I have Dataset that I need to filter into another Dataset for display and I
can not find out how to do this. I have found methods for copying a Dataset
but I can not see how to filter the rows copied using my query.

I hoped to be able to use a DataAdaptor to do this but SelectCommand
requires a connection and I don''t see how to create a connection to my
Dataset object.

Any pointers would be much appreciated.
Sid.

(VB.NET 2003)

推荐答案

您可以使用表格的数据视图进行显示。


dv =新DataView()

dv。表= ds.Tables(" Customers")

dv.RowFilter =" Country =''USA''"


然后使用dataview显示。


您还可以使用dv.ToTable将数据视图复制到新表格。


Robin S.

Ts''i mahnu uterna ot twan ot geifur hingts uto。

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

Sid Price&q UOT; < si*@nowhere.com写信息

新闻:uQ ************** @ TK2MSFTNGP04.phx.gbl ...
You can use a dataview of the table for display.

dv = New DataView()
dv.Table = ds.Tables("Customers")
dv.RowFilter = "Country = ''USA''"

Then use the dataview to display.

You can also copy the dataview to a new table using dv.ToTable.

Robin S.
Ts''i mahnu uterna ot twan ot geifur hingts uto.
-----------------------------------------------
"Sid Price" <si*@nowhere.comwrote in message
news:uQ**************@TK2MSFTNGP04.phx.gbl...

>我有数据集,我需要过滤到另一个数据集进行显示和
我无法找到如何做到这一点。我找到了复制
数据集的方法,但我看不到如何过滤使用我的查询复制的行。


我希望能够使用DataAdaptor来做这个但是SelectCommand

需要连接,我不知道如何建立与我的

数据集对象的连接。


任何指针都会非常感激。

Sid。


(VB.NET 2003)

>I have Dataset that I need to filter into another Dataset for display and
I can not find out how to do this. I have found methods for copying a
Dataset but I can not see how to filter the rows copied using my query.

I hoped to be able to use a DataAdaptor to do this but SelectCommand
requires a connection and I don''t see how to create a connection to my
Dataset object.

Any pointers would be much appreciated.
Sid.

(VB.NET 2003)



Robin,


DataView.ToTable不是定义的方法......我使用的是VB.NET 2003.


我没有看到任何方法将DataView中的过滤数据导入我的新

数据集。


Sid 。

" RobinS" < Ro **** @ NoSpam.yah.nonewrote in message

新闻:Wq ************************ ******@comcast.com。 ..
Robin,

DataView.ToTable is not a defined method ... I am using VB.NET 2003.

I don''t see any way to get the filtered data from the DataView into my new
Dataset.

Sid.
"RobinS" <Ro****@NoSpam.yah.nonewrote in message
news:Wq******************************@comcast.com. ..

您可以使用表格的数据视图进行显示。


dv =新DataView()

dv.Table = ds.Tables(" Customers")

dv.RowFilter =" Country =''USA''"


然后使用数据视图显示。


您还可以使用dv.ToTable将数据视图复制到新表。


Robin S.

Ts''i mahnu uterna ot twan ot geifur hingts uto。

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

" Sid Price" < si*@nowhere.com写信息

新闻:uQ ************** @ TK2MSFTNGP04.phx.gbl ...
You can use a dataview of the table for display.

dv = New DataView()
dv.Table = ds.Tables("Customers")
dv.RowFilter = "Country = ''USA''"

Then use the dataview to display.

You can also copy the dataview to a new table using dv.ToTable.

Robin S.
Ts''i mahnu uterna ot twan ot geifur hingts uto.
-----------------------------------------------
"Sid Price" <si*@nowhere.comwrote in message
news:uQ**************@TK2MSFTNGP04.phx.gbl...

>>我有数据集,我需要过滤到另一个数据集进行显示和
我无法找到如何做到这一点。我找到了复制
数据集的方法,但我看不到如何过滤使用我的查询复制的行。

我希望能够使用DataAdaptor来执行此操作,但SelectCommand <需要连接,我不知道如何创建与我的
数据集对象的连接。

任何指针都将非常感激。
Sid。

(VB.NET 2003)

>>I have Dataset that I need to filter into another Dataset for display and
I can not find out how to do this. I have found methods for copying a
Dataset but I can not see how to filter the rows copied using my query.

I hoped to be able to use a DataAdaptor to do this but SelectCommand
requires a connection and I don''t see how to create a connection to my
Dataset object.

Any pointers would be much appreciated.
Sid.

(VB.NET 2003)




Sid,


为什么需要将数据放入新的数据集/数据表中?


只需使用过滤后的数据视图进行显示即可它是什么。


ToTable方法是.Net 2.0中的新方法,但你不需要它来显示




Kerry Moorman

" Sid Price写道:
Sid,

Why do you need to get the data into a new dataset/datatable?

Just use the filtered dataview for display, that''s what it is for.

The "ToTable" method is new in .Net 2.0, but you should not need it for
display purposes.

Kerry Moorman
"Sid Price" wrote:

Robin,


DataView.ToTable不是定义的方法...我使用的是VB.NET 2003 。


我没有看到任何方法将DataView中的过滤数据导入我的新

数据集。


Sid。


" RobinS" < Ro **** @ NoSpam.yah.nonewrote in message

新闻:Wq ************************ ******@comcast.com。 ..
Robin,

DataView.ToTable is not a defined method ... I am using VB.NET 2003.

I don''t see any way to get the filtered data from the DataView into my new
Dataset.

Sid.
"RobinS" <Ro****@NoSpam.yah.nonewrote in message
news:Wq******************************@comcast.com. ..

您可以使用表格的数据视图进行显示。


dv =新DataView()

dv.Table = ds.Tables(" Customers")

dv.RowFilter =" Country =''USA''"


然后使用数据视图显示。


您还可以使用dv.ToTable将数据视图复制到新表。


Robin S.

Ts''i mahnu uterna ot twan ot geifur hingts uto。

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

" Sid Price" < si*@nowhere.com写信息

新闻:uQ ************** @ TK2MSFTNGP04.phx.gbl ...
You can use a dataview of the table for display.

dv = New DataView()
dv.Table = ds.Tables("Customers")
dv.RowFilter = "Country = ''USA''"

Then use the dataview to display.

You can also copy the dataview to a new table using dv.ToTable.

Robin S.
Ts''i mahnu uterna ot twan ot geifur hingts uto.
-----------------------------------------------
"Sid Price" <si*@nowhere.comwrote in message
news:uQ**************@TK2MSFTNGP04.phx.gbl...

>我有数据集,我需要过滤到另一个数据集进行显示和
我无法找到如何做到这一点。我找到了复制
数据集的方法,但我看不到如何过滤使用我的查询复制的行。


我希望能够使用DataAdaptor来做这个但是SelectCommand

需要连接,我不知道如何建立与我的

数据集对象的连接。


任何指针都会非常感激。

Sid。


(VB.NET 2003)

>I have Dataset that I need to filter into another Dataset for display and
I can not find out how to do this. I have found methods for copying a
Dataset but I can not see how to filter the rows copied using my query.

I hoped to be able to use a DataAdaptor to do this but SelectCommand
requires a connection and I don''t see how to create a connection to my
Dataset object.

Any pointers would be much appreciated.
Sid.

(VB.NET 2003)






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

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