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

DataSet - what is the best way

I have a SQL table that has a bunch of data in it. For a particular
execution, some subset of that data is is relevant and is downloaded into a
DataSet table. Now, all the information is available.

At different times during program execution, various rows from the table
will need to be referenced. The accessing order is random. The data is
accessed via unique keys in the table.

What is the best way to accomplish this?

A. Is there a way for me to perform queries on the DataTable? I'm not
aware of this capability.
B. Should I unload the table into a sorted list indexed by the key - I
tink this is the solution I need?
C. Always query the database for the required row - wasteful and
unnecessary.


Nov 16 '05 #1
5 1393
You can filter on the default view of a datatable. This even works with
a master-detail relationship.

http://www.geocities.com/jeff_louie/query_framework.htm
http://www.geocities.com/jeff_louie/net_filtering.htm

Regards,
Jeff
Is there a way for me to perform queries on the DataTable? I'm not aware
of this capability.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #2
Web11110

You can use

The datatable.select (returns a datarowcollection)
The dataview.rowfilter (filters the datatable by the filter)
The dataview.find (return an index to a datarowview)
The datarowcollection.find (returns one datarow by the primarykey)

I hope this helps,

Cor
Nov 17 '05 #3
Thanx, this is the course I need to follow.

I am playing with the NorthWind database using the employes table. I have
the table resident in the DataSet and assigned as DataView to the table.

But I am having a problem getting all the rest of the pieces together.

The rowfilter filters OUT everything that MATCHES the condition, right? So
I want to negate the key I want to retrieve.

For instance,

dataView1.RowFilter="EmployeeId != '2'";

Givesme the error:

Cannot interpret token '!' at position 12.

I can use a little help getting all the parts together.

Thanx,
Bill

Nov 17 '05 #4
Hi,

Why would it be != when = is the equal operator and not ==.

The unequal operator is <>
http://msdn.microsoft.com/library/de...ssiontopic.asp

I hope this helps,

Cor
Nov 17 '05 #5
arggggggghhhhh!!!!!!!!!!!!!!!

Just not thnking. Sorry!!!!

"Cor Ligthert" <no************@planet.nl> wrote in message
news:eX**************@TK2MSFTNGP09.phx.gbl...
Hi,

Why would it be != when = is the equal operator and not ==.

The unequal operator is <>
http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfsystemdatadatacolumnclassexpressiontopic.asp
I hope this helps,

Cor

Nov 17 '05 #6

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

Similar topics

4
by: geilen | last post by:
I'm trying to use a dataset returned from a web service in an unmanaged C++ (MFC) client. The dataset is returned as a BSTR, and I'm having trouble reading the BSTR into an XML document for...
3
by: Dev | last post by:
Good Morning to all, I have a bunch of XML files that need to be readed inside the same DataSet (each XML represent a single table). In the event of a large (some megabytes) file, what is the...
5
by: Trond | last post by:
I have a webservice that is returning a dataset. In dataset there is a table with 4 columns. (LDate, LTime, LDepth and ServiceNumber) I then try to read only 2 of the columns into array (double...
4
by: Oscar Thornell | last post by:
Hi, I have a relativley large/complex typed dataset that contains 7-8 tables and some supporting relational tables (lookups) for many-to-many relations. A good exampel would be a dataset that...
14
by: Bihn | last post by:
I was reading about datareader which is said to be slimmer & faster then dataset. Since the datareader have to go fetching the dat from the database every time it need it, the data it gets then...
2
by: John Granade | last post by:
I'm looking for the best way to make a dataset available from multiple Windows forms. The dataset is created from an XML file. I have a main form (frmMain) that loads the dataset and reads the...
10
by: jaYPee | last post by:
I have a function that call a stored procedure which performs an insert command. now i want to refresh the dataset so that the newly inserted data will be available to my datagrid I have tried...
9
by: Mr Newbie | last post by:
HI People, Thanks to all who helped me earlier on the subject of @@IDentity. However, I seem to have hit another snagette! My DataSet contains two tables from the SQL Server. lets say Master...
13
by: Maxwell2006 | last post by:
Hi, We are having a debate over using DataSet as return value type for web services. The problem is that we don't know whether Java applications can use DataSet
4
by: David | last post by:
Hi, (Sorry for duplicate post, finger trouble before I finished...) using C# 1.1 I am writing a winform app that collects a dataset from a webservice. At the same time I collect the data,...
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.