locked
DataSet Versus DataReader Question? Thanks. RRS feed

  • Question

  • User1608082067 posted
    Hello,

    I want to retrive N records from a database (I am using SQL and Access in 2 different projects):

    id    class     text
    1     book    book comments
    2     paper   paper comments
    ...

    I will filter records according to "class" field values.
    I will allways get ONLY 2 to 4 records which [text] field I will display in different places of my page.

    Should I use a dataset or a datareader?
    If I should use a datareader how can i create one? (I only know how to create a dataset).

    Thank You,
    Miguel

    Thursday, April 21, 2005 3:35 PM

All replies

  • User-1786411686 posted
    >>I want to retrive N records from a database
     
    You can do a "SELECT TOP N col1,col2,col3 FROM tablename".
     
    >>I will filter records according to "class" field values.
    dpends on what you mean by filtering? would you be using a where clause or do you want to get the entire recordse and fill it in a dataset and filter it out from there ? You can use a datareader too but filtering is on a row by row basis...you need to read each row and check the values in the columns programmatically.
    Friday, April 22, 2005 11:13 AM