?
Solved

How to filter multiple row of records in DataTable in the Dataset

Posted on 2015-02-09
6
Medium Priority
?
98 Views
Last Modified: 2015-02-11
I am currently filtering column name : SCR_DPY_SEQ which has records certain records by using the below syntax.

Syntax filters only few records and not all..

And this syntax is very cumbersome to manage .. Is there a better way to filter Multiple row of records in a Database within the Dataset ??

 
PTDs.Merge(ds.Tables("p_tree").Select("SCR_DPY_SEQ <> '30003039' AND SCR_DPY_SEQ <> '30003040' AND SCR_DPY_SEQ <> '30003041' AND SCR_DPY_SEQ <> '30003042' AND SCR_DPY_SEQ <> '30003043' AND SCR_DPY_SEQ <> '30003121' AND SCR_DPY_SEQ <> '30003122' AND SCR_DPY_SEQ <> '30003123' AND SCR_DPY_SEQ <> '30003124' AND SCR_DPY_SEQ <> '30003125' AND SCR_DPY_SEQ <> '30003203' AND SCR_DPY_SEQ <> '30003204' AND SCR_DPY_SEQ <> '30003205' AND SCR_DPY_SEQ <> '30003206' AND SCR_DPY_SEQ <> '30003207' AND SCR_DPY_SEQ <> '30003285' AND SCR_DPY_SEQ <> '30003286' AND SCR_DPY_SEQ <> '30003287' AND SCR_DPY_SEQ <> '30003288' AND SCR_DPY_SEQ <> '30003289' AND SCR_DPY_SEQ <> '30003367' AND SCR_DPY_SEQ <> '30003368' AND SCR_DPY_SEQ <> '30003369' AND SCR_DPY_SEQ <> '30003370' AND SCR_DPY_SEQ <> '30003371'"))

Open in new window

0
Comment
Question by:chokka
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 47

Expert Comment

by:Wayne Taylor (webtubbs)
ID: 40599325
You could use this....

PTDs.Merge(ds.Tables("p_tree").Select("SCR_DPY_SEQ NOT IN ('30003039', '30003040', '30003041' , '30003042', '30003043', '30003121', '30003122', '30003123', '30003124', '30003125', '30003203', '30003204', '30003205', '30003206', '30003207', '30003285', '30003286', '30003287', '30003288', '30003289', '30003367', '30003368', '30003369', '30003370', '30003371')"))
0
 
LVL 34

Accepted Solution

by:
Mike Eghtebas earned 2000 total points
ID: 40599425
or possibly:

PTDs.Merge(ds.Tables("p_tree").Select("SCR_DPY_SEQ < '30003039' OR SCR_DPY_SEQ NOT >'30003371'"))

revised...
0
 

Author Comment

by:chokka
ID: 40599923
There is another column name : GROUP_CODE, i need to filter SG.

This will reduce the code.

PTDs.Merge(ds.Tables("p_tree").Select("GROUP_CODE not like SG"))

How to use - SELECT NOT LIKE
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 34

Expert Comment

by:Mike Eghtebas
ID: 40599944
SELECT * From Table1 As t Where t.Name Not In(Select .t2.Name From Table2 t2)

This is one out of many variations.
0
 

Author Comment

by:chokka
ID: 40599968
Thanks , by any chance - can you please rewrite your syntax in a compilable ..
0
 

Author Closing Comment

by:chokka
ID: 40604814
Thanks
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question