473,387 Members | 1,790 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,387 software developers and data experts.

How to convert a DataView with RowFilter to a new DataTable?

Hello,
I have this:

Dim dv As New DataView(GetUsersAsDataTable())
dv.RowFilter = "brithday >= 1970"

Dim dt As New DataTable
dt = **how to bring my rowfiltered DataView to a new DataTable** ?

When I do
dt = dv.Table
I get my original DataTable so that is unfortunatly not the solution.

Thanks for any help in advance!!
Andreas
Nov 18 '05 #1
2 2395
B
What are you trying to do?

"Andreas Klemt" <ak******@hotmail.com> wrote in message
news:OW**************@TK2MSFTNGP10.phx.gbl...
Hello,
I have this:

Dim dv As New DataView(GetUsersAsDataTable())
dv.RowFilter = "brithday >= 1970"

Dim dt As New DataTable
dt = **how to bring my rowfiltered DataView to a new DataTable** ?

When I do
dt = dv.Table
I get my original DataTable so that is unfortunatly not the solution.

Thanks for any help in advance!!
Andreas

Nov 18 '05 #2
Andreas Klemt wrote:
Hello,
I have this:

Dim dv As New DataView(GetUsersAsDataTable())
dv.RowFilter = "brithday >= 1970"

Dim dt As New DataTable
dt = **how to bring my rowfiltered DataView to a new DataTable** ?

When I do
dt = dv.Table
I get my original DataTable so that is unfortunatly not the solution.

Thanks for any help in advance!!
Andreas


Unfortunately you have to manually do this. Loop through the DataView's
items and copy them (import) to a new DataTable.

--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET

Nov 18 '05 #3

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

Similar topics

4
by: Jim Heimer | last post by:
When I use the dataview.rowfilter and I try to display the field value of the first row, the code doesn't seem to show the first row AFTER the rowfilter. This is my code: DataView...
2
by: Jensen bredal | last post by:
Hello, I use The RowFilter property to select number of row from my dataview. How can i get the number of rows found ? I experience that the number of rows remains the same as before the...
8
by: Dave Hagerich | last post by:
I'm using a DataGrid with a DataSet and I'm trying to filter the data being displayed, using the following code as a test: DataView theView = new DataView(theDataSet.Tables); theView.RowFilter =...
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...
14
by: Able | last post by:
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...
3
by: gilly3 | last post by:
I have a column in a DataView that contains NaN. When I attempt to Sort on this column, I get: MESSAGE: Index was outside the bounds of the array. SOURCE: System.Data STACKTRACE: at...
4
by: James | last post by:
Basically I have a DataGrid that I'm binding to the results of a stored procedure call. The recordset is fairly small. Initially I'm creating a DataSet from the results and binding it. There's a...
1
by: neeraj | last post by:
Hi All Can any give me the code for convert "DataColumn" data type of "DataTable". Even if data table already populated (have data) Actually I am creating one search module which searches the...
3
by: =?Utf-8?B?cG1jZ3VpcmU=?= | last post by:
I have a dataset with 3 tables -- 2 Parent tables and 1 table that is a child table of both the parents. I create a dataview on the child table and set the rowfilter to a value which filters the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.