473,320 Members | 1,990 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Dataview

Hi all, please, I would like to ask something:

I do have a dataview(dv1) with several Identifiers, then I want to creat a
new dataview(dv2) which row filter is any Identifier contained into the
other dataview ( dv1).

Thank you very much
Fadoyo Orithsuma.
Nov 20 '05 #1
3 977
Hi,

It would probably be something like this if I got you right:

Dim filter As New StringBuilder

Dim rowView As DataRowView
ForEach rowView in dataView1
If filter.Length > 0 Then
filter.Append(" OR ")
End If

filter.AppendFormat("Identifier={0}",
rowView("IdentifierColumn").ToString())
Next

dataView2.RowFilter = filter.ToString()

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Fadoyo" <fa****@hotmail.com> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
Hi all, please, I would like to ask something:

I do have a dataview(dv1) with several Identifiers, then I want to creat a
new dataview(dv2) which row filter is any Identifier contained into the
other dataview ( dv1).

Thank you very much
Fadoyo Orithsuma.


Nov 20 '05 #2
Hi, thank you,

Fadoyo
"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.com> wrote
in message news:ub**************@tk2msftngp13.phx.gbl...
Hi,

It would probably be something like this if I got you right:

Dim filter As New StringBuilder

Dim rowView As DataRowView
ForEach rowView in dataView1
If filter.Length > 0 Then
filter.Append(" OR ")
End If

filter.AppendFormat("Identifier={0}",
rowView("IdentifierColumn").ToString())
Next

dataView2.RowFilter = filter.ToString()

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Fadoyo" <fa****@hotmail.com> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
Hi all, please, I would like to ask something:

I do have a dataview(dv1) with several Identifiers, then I want to creat a new dataview(dv2) which row filter is any Identifier contained into the
other dataview ( dv1).

Thank you very much
Fadoyo Orithsuma.

Nov 20 '05 #3
Fadoyo,
Alternatively you could use the "In" operator, instead of the OR operator.

Something like (variation of Dmitriy's sample):

Dim filter As New StringBuilder ("Identifier In (")

Dim needDelim As Boolean = false

Dim rowView As DataRowView
For Each rowView in dataView1
If needDelim Then
filter.Append(","c)
End If

filter.Append(rowView("IdentifierColumn"))
needDelim = True
Next
filter.Append(")"c)

dataView2.RowFilter = filter.ToString()

I tend to prefer the "In" operator over a list of "Or" operators, as IMHO
the In operator is "easier" to follow. Otherwise they both do the same
thing!

Hope this helps
Jay

"Fadoyo" <fa****@hotmail.com> wrote in message
news:eL**************@TK2MSFTNGP10.phx.gbl...
Hi, thank you,

Fadoyo
"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.com> wrote
in message news:ub**************@tk2msftngp13.phx.gbl...
Hi,

It would probably be something like this if I got you right:

Dim filter As New StringBuilder

Dim rowView As DataRowView
ForEach rowView in dataView1
If filter.Length > 0 Then
filter.Append(" OR ")
End If

filter.AppendFormat("Identifier={0}",
rowView("IdentifierColumn").ToString())
Next

dataView2.RowFilter = filter.ToString()

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Fadoyo" <fa****@hotmail.com> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
Hi all, please, I would like to ask something:

I do have a dataview(dv1) with several Identifiers, then I want to creat
a
new dataview(dv2) which row filter is any Identifier contained into

the other dataview ( dv1).

Thank you very much
Fadoyo Orithsuma.


Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: RPI_alum | last post by:
I've been experiencing some frustrating behavior that I believe may be a MS bug in the Framework. Has anyone else experienced this, know a better way to resolve it, or if it is an actual MS bug ...
9
by: jwedel_stolo | last post by:
Hi I'm creating a dataview "on the fly" in order to sort some data prior to writing out the information to a MS SQL table I have used two methods in order to determine the sort order of the...
4
by: Martin Schmid | last post by:
I am trying to implement a DataView for a DataGrid so I can sort at runtime by clicking on column headers. My initial page load works... it displays the data However, when I click a column...
2
by: Alpha | last post by:
I have a window application. In one of the form, a datagrid has a dataview as its datasource. Initial filtering result would give the datavew 3 items. When I double click on the datagrid to edit...
36
by: kjvt | last post by:
Based on a prior posting, I've written a function to convert a recordset to a dataview. The first call to the function for a given recordset works perfectly, but the second call always returns a...
13
by: Steve | last post by:
I have a form with a dataset and a datagrid. I created a dataview on this dataset. When the user modifies the datagrid, I look up this record in the dataview to make sure it is unique. Here is...
5
by: David Wender | last post by:
I want to create a dataview with a sort on multiple columns. However, when I use FindRows, I only want to search some of the columns, not all. Is this possible? I have not been able to make it...
3
by: astro | last post by:
I have a datagrid that is two levels down from the dataview (i.e. grandchild). I have spent 3 hours trying to get the syntax of determining it's real datasource (i.e. not it's source based on it's...
5
by: enceladus311 | last post by:
I'm trying to find a way to keep from having to fill a DataView after every PostBack to a page. Basically, the design is that I have a DataView that I fill, which I then set as the DataSource to a...
0
by: Pravin Pujari | last post by:
Hi All, I am using .net framework 1.1 and c#. I have one problem regarding dataview. I have one dataview to which sorting may be applied or may not be applied. I have one UI component where I...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.