SgDotNet
Singapore Professional .NET User Group -For Cool Developers

Filter datatable based on another datatable

Latest post 10-23-2007 8:08 PM by icelava. 18 replies.
  • 10-09-2007 3:23 PM In reply to

    Re: Filter datatable based on another datatable

    CREATE PROCEDURE uspStaff_List
    @IsMgrID INT,
    @IsDeptID INT,
    @IsNotMgrID INT,
    @IsNotDeptID INT
    AS
    SELECT StaffID, DeptID, StaffName, MgrID
    FROM tblStaff
    WHERE MgrID = @IsMgrID AND MgrID <> @IsNotMgrID AND DeptID = @IsDeptID AND Deptid <> @IsNotDeptID

    This is just a sample SQL query and you would pass in the parameters you want to filter.

  • 10-09-2007 10:32 PM In reply to

    Re: Filter datatable based on another datatable

    Coincedentally, I came across this solution to select distinct, sort and filter a datatable.

    Check out this post http://www.codeproject.com/useritems/SelectDistinct.asp on The Code Project. He mentioned that the object can take 40,000 records and turn them into around 2000 distinct records in a little over a second.

    Not sure if it works in your case, but worth exploring.

  • 10-12-2007 5:07 PM In reply to

    Re: Filter datatable based on another datatable

    eric_tcp:

    Is it possible to filter datatable based on another datatable or dataset?...

     

    Thanks. 

    I came out with an idea that pass the sql query to database for inner join the table which contains data I want, it is just take me few seconds.

  • 10-23-2007 8:08 PM In reply to

    Re: Filter datatable based on another datatable

    eric_tcp:
    Will this iterating faster than datatview.Filter, which take more than 10 seconds to filter 1000 row of data?

    I don't know since I was just penning down thoughts. Why don't you try it in experiments with your samples of data and collect and witness the results first hand?

    The melody of logic will always play out the truth. ~ Narumi Ayumu, Spiral

Page 2 of 2 (19 items) < Previous 1 2 | RSS
Copyright SgDotNet 2004-2008
Powered by Community Server (Commercial Edition), by Telligent Systems