Displaying records in a ListBox

Last post 07-17-2008 3:25 AM by Nicolai. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 07-15-2008 2:52 PM

    • Nicolai
    • Top 25 Contributor
    • Joined on 12-03-2007
    • Wannabe Slacker
    • Points 552

    Displaying records in a ListBox

    I need to create the DataSet which will be filled with all records from the SalesOrderHeader table where the SalesPersonID = 399. From there, two tables will be generated that will contain a subset of that data. The first table will contain those records from the DataSet whose ContactID = 30. The second table contains those records from the DataSet whose CustomerID = 478. The Intersect comparison operator will then be used to return those records that are the same in each table. Those records will be displayed in the list box.

    I need idea from someone to get this job done. Please give me some idea.

    Nicolai
    Follow MS and develop better Software
  •  Advertisement

    Featured Advertisement

     
  • 07-16-2008 6:35 AM In reply to

    Re: Displaying records in a ListBox

    What I understood is, you are having one table SalesOrderHeader table with some fields like SalesPersonID, ContactID and CustomerID. You need to fetch the records wher e SalesPersonID = 399. Further you need to FILTER this dataset with ContactID=30 and CustomerID=478.

    you can simply filter with RowFilter Property as..

    dsDataSet.Tables[0].DefaultView.RowFilter = "ContactID=30 And CustomerID=478";

    Thus, Filtered dsDataSet DataSet will contain the records which is having SalesPersonID=399, ContactID=30 and CusomerID=478.


    Please, let me know if this is not the case.
    hope it helps./.

     

    "I would love to change the world, but they won’t give me the source code"

    Don't forget to click "Mark as Answer" on the post that helped you.
    This credits that member, earns you a point & mark your thread as Resolved for the sake of Future Readers.

    KaushaL || BLOG || Profile || Microsoft MVP
  • 07-17-2008 3:25 AM In reply to

    • Nicolai
    • Top 25 Contributor
    • Joined on 12-03-2007
    • Wannabe Slacker
    • Points 552

    Re: Displaying records in a ListBox

    Hi Kaushal,

    Thanks for your reply. Would you please explain a little bit more? I mean the complete example would be much helpful for me. Please help me.

    Nicolai
    Follow MS and develop better Software
    Filed under:
Page 1 of 1 (3 items)