将多个表分配给一个 DataView

发布于 2024-08-09 02:33:53 字数 322 浏览 6 评论 0原文

net与vb和sql server 2005。

我有包含3个表的数据集,我想将所有3个表分配到一个DataView中

我知道可以通过这样做单独分配每个表:

Dim dv as New DataView(ds.Tables(i)).DefaultView

但我需要数据集中的所有表和不仅基于 i 的索引表,

我还考虑使用可以分配给整个数据集的 DataViewManager

,但它没有

我稍后在代码中使用的 RowFilter 预言。

那么我该如何解决这个问题呢?

net with vb and sql server 2005.

i have DataSet with 3 tables in it and i want to asign all 3 tables into one DataView

i know its possible to assign each table seperatly by doing this:

Dim dv as New DataView(ds.Tables(i)).DefaultView

but i need all the tables in the dataset and not only the i based index table

i also thought about using DataViewManager which can be assigned to the whole Dataset

but it doesn't have the RowFilter prophety

which i am using Later on my code.

so how do i solve this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

森林散布 2024-08-16 02:33:53

这篇文章应该可以帮助您

您可以做一些事情像这样(文章的片段)

myDataViewManager.DataViewSettings("Customers").Sort = "CompanyName"
myDataViewManager.DataViewSettings("Customers").RowFilter = "Where clause here"

希望这有帮助

This article should help you

You can do something like this (snippet from the article)

myDataViewManager.DataViewSettings("Customers").Sort = "CompanyName"
myDataViewManager.DataViewSettings("Customers").RowFilter = "Where clause here"

Hope this helps

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文