473,508 Members | 4,628 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DataTable.DefaultView

I'm trying to filter the data as I load a dataset, so I
set the RowFilter property of the DataTable's
DefaultView. But the dataset still contains all of the
records. Is the row filter (and dataviews) meant to be
used only for accessing data rather than loading the
dataset? Maybe I'm using it wrong. Why else would it load
the entire table? Do I have to actually change the
SelectCommand in the DataAdapter in order to limit what
gets loaded in DataSet?
Nov 15 '05 #1
2 14676
Try reading it this way

foreach(DataRowView drv in dv)
{ System.Data.DataRow dr = drv.Row;
..... <more..code>
}

Pramod
"sandman" <sa*********@yahoo.com> wrote in message
news:04****************************@phx.gbl...
I'm trying to filter the data as I load a dataset, so I
set the RowFilter property of the DataTable's
DefaultView. But the dataset still contains all of the
records. Is the row filter (and dataviews) meant to be
used only for accessing data rather than loading the
dataset? Maybe I'm using it wrong. Why else would it load
the entire table? Do I have to actually change the
SelectCommand in the DataAdapter in order to limit what
gets loaded in DataSet?

Nov 15 '05 #2
MP
Yes...
your data adapter is the one that fill the dataset
the dataview is for going filter, sort, allow... and back

"sandman" <sa*********@yahoo.com> wrote in message
news:8c****************************@phx.gbl...
That wasn't my question. The dataview works fine, and I'm
using it just as you described. But when I was debugging,
I was surprised to find all the records were in the
dataset. What I'm trying to figure out is whether the
DefaultView has anything to do with what actually gets
loaded in the DataSet or if it's just meant to be used to
screen out a subset of the whole table?

-----Original Message-----
Try reading it this way

foreach(DataRowView drv in dv)
{ System.Data.DataRow dr = drv.Row;
..... <more..code>
}

Pramod
"sandman" <sa*********@yahoo.com> wrote in message
news:04****************************@phx.gbl...
I'm trying to filter the data as I load a dataset, so I
set the RowFilter property of the DataTable's
DefaultView. But the dataset still contains all of the
records. Is the row filter (and dataviews) meant to be
used only for accessing data rather than loading the
dataset? Maybe I'm using it wrong. Why else would it load the entire table? Do I have to actually change the
SelectCommand in the DataAdapter in order to limit what
gets loaded in DataSet?

.

Nov 15 '05 #3

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

Similar topics

4
954
by: Job Lot | last post by:
Is it possible to run a select query on DataTable object? Say for instance, my DataTable had following structure StudentID, SubjectID, Score Now, I want list of Score where Score IS NOT NULL...
3
6330
by: Solel Software | last post by:
Hello, I have a basic question. I have a DataTable of information without a database store (it's only in memory). I am looking to somehow query the DataTable to find out which row(s) satisfy...
1
9792
by: Gary | last post by:
Hi, I have a DataTable, which will have 2 Columns, one column holds Unique values. I will use DataTable.Select(Unique value) and Filter the Matching rows, After filtering those rows I want...
6
2225
by: Young J. Putt | last post by:
I've got a list box bound to a Datatable, like this: lstProjects.DataSource = m_oProjectSet.DataTable lstProjects.DisplayMember = "ProjectDesc" lstProjects.ValueMember = "ProjectID" I want to...
2
1211
by: Young J. Putt | last post by:
I've got a list box bound to a Datatable, like this: lstProjects.DataSource = m_oProjectSet.DataTable lstProjects.DisplayMember = "ProjectDesc" lstProjects.ValueMember = "ProjectID" I want to...
4
15086
by: Bruce A. Julseth | last post by:
I'm new to VB.NET and just gettng into database "Learning." How do I decide if I need a DataTable or a DataView. Thanks... Bruce
6
83135
by: Necqui Teja | last post by:
I have UPC and ItemNo as columns in my DataTable dt. How do I sort the columns in my method prior to return dt; I tried the following but it doesn't seem to work. dt.DefaultView.Sort = "UPC...
4
5991
by: Rich | last post by:
Hello, I need to store various values that I will need to look up later on. I have been using hashtables and arraylists. But I can only store 2 items per row in a hashtable - key, value, and...
1
4214
by: Ryan Liu | last post by:
Hi, I thought the following code is tedious but pretty safe, unexpected this.dataTable.DefaultView itself throw an System.NullReferenceException? if(this.dataTable!= null &&...
0
7228
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
7128
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...
0
7502
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5635
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5057
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4715
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3191
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
769
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
426
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.