PC Review


Reply
Thread Tools Rate Thread

DataSet - what is the best way

 
 
web1110
Guest
Posts: n/a
 
      22nd Mar 2005
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.




 
Reply With Quote
 
 
 
 
Jeff Louie
Guest
Posts: n/a
 
      22nd Mar 2005
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!
 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      22nd Mar 2005
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


 
Reply With Quote
 
web1110
Guest
Posts: n/a
 
      22nd Mar 2005
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





 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      22nd Mar 2005
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


 
Reply With Quote
 
web1110
Guest
Posts: n/a
 
      22nd Mar 2005
arggggggghhhhh!!!!!!!!!!!!!!!

Just not thnking. Sorry!!!!

"Cor Ligthert" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to cast object of type 'System.Data.DataSet' to Typed DataSet Optimus Microsoft VB .NET 1 31st Jan 2006 06:26 AM
Ccopying a datatable content from an untyped dataset into a table which is inside a typed dataset Nedu N Microsoft ADO .NET 7 9th Dec 2003 02:50 PM
copying a datatable content from an untyped dataset into a table which is inside a typed dataset Nedu N Microsoft ADO .NET 2 31st Oct 2003 01:05 PM
copying a datatable content from an untyped dataset into a table which is inside a typed dataset Nedu N Microsoft ASP .NET 2 31st Oct 2003 01:05 PM
Ccopying a datatable content from an untyped dataset into a table which is inside a typed dataset Nedu N Microsoft ASP .NET 2 31st Oct 2003 02:42 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:56 AM.