Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2005
    Posts
    55

    Lightbulb Unanswered: to use a dataset or not...

    ok, i have a question.

    im developing an application, and want to know some pro's and con's with using a dataset or using direct connection to database...

    also a breif description of what a dataset is would be very handy...

    Thanks, Justin

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by freefall
    a breif description of what a dataset is would be very handy...
    as i was reading your question, i was thinking this exact same thing
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Aug 2005
    Posts
    55
    Quote Originally Posted by r937
    as i was reading your question, i was thinking this exact same thing
    ok, maybe im confused. lol. i thought that they were 2 seperate types of data access, as one uses an xml representation of a database?? or am i totally out of the idea??

  4. #4
    Join Date
    Nov 2005
    Location
    San Francisco, CA
    Posts
    506
    Quote Originally Posted by freefall
    ok, maybe im confused. lol. i thought that they were 2 seperate types of data access, as one uses an xml representation of a database?? or am i totally out of the idea??
    A dataset provides you with a memory- resident representation of data,you can work with the results of a databse query as a whole.For example, a Dataset includes methods for sorting, filtering and returning a count of records from a database query.

    A dataset represents a disconnected set of records.When a dataset is populated with records,you can break the connection with its data source.This means that you can easily cache a dataset in your's server memory and achieve dramatic performance benefits.

    When used wisely, Dataset can dramatically improve the performance of your Web application.If you need to represent the same set of records over and over again in multiple pages you can represent the records in Dataset abd cache it in server's memory.Caching will enable you to avoid connecting the database again and again.

    And if you use it badly,dataset can hurt the performance of the website.
    Dataset can occupy a lot of memory.If you are using to represent a table with 20,000 records and if 100 user are requesting it at the same time then 2000000 records must there in your server's memory.


    Whereas direct connection is good for real time data.I mean where we are asking for single data at a time.As for example in .Net we find the DataReader uses direct connection with database.Its just like a ADO recordset with a forward only cursor.
    I think now it would be easy for you to understand the pros and cons of the same.
    Success is the ability to go from one failure to another with no loss of enthusiasm.
    - Sir Winston Churchill
    Joydeep

  5. #5
    Join Date
    Aug 2005
    Posts
    55
    Quote Originally Posted by rudra
    A dataset provides you with a memory- resident representation of data,you can work with the results of a databse query as a whole.For example, a Dataset includes methods for sorting, filtering and returning a count of records from a database query.

    A dataset represents a disconnected set of records.When a dataset is populated with records,you can break the connection with its data source.This means that you can easily cache a dataset in your's server memory and achieve dramatic performance benefits.

    When used wisely, Dataset can dramatically improve the performance of your Web application.If you need to represent the same set of records over and over again in multiple pages you can represent the records in Dataset abd cache it in server's memory.Caching will enable you to avoid connecting the database again and again.

    And if you use it badly,dataset can hurt the performance of the website.
    Dataset can occupy a lot of memory.If you are using to represent a table with 20,000 records and if 100 user are requesting it at the same time then 2000000 records must there in your server's memory.


    Whereas direct connection is good for real time data.I mean where we are asking for single data at a time.As for example in .Net we find the DataReader uses direct connection with database.Its just like a ADO recordset with a forward only cursor.
    I think now it would be easy for you to understand the pros and cons of the same.
    Ok, thats helps alot to clear up what a dataset is. but im using it for Windows Forms Development...

    does that make a difference to whether i should use one?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •