locked
Handling Dataset in Application Level RRS feed

  • Question

  • I have a requirement where I need to handle a set of tables with some smaller number of rows.

    And the chance of these rows getting updated is very low, So I dont want to visit the database now and then. But still I want the data in the database.

    Now is it possible/recommended to load all theses tables in the application session state as a DataSet and operate on it.

    And there are some stored procedures which or operate on this tables. How can i stimulate the functions of those stored procedures.

     

     

     

     


    Surendran Anthony.
    Thursday, December 1, 2011 12:40 PM

Answers

  • I have a requirement where I need to handle a set of tables with some smaller number of rows.

    And the chance of these rows getting updated is very low, So I dont want to visit the database now and then. But still I want the data in the database.

    Now is it possible/recommended to load all theses tables in the application session state as a DataSet and operate on it.

    And there are some stored procedures which or operate on this tables. How can i stimulate the functions of those stored procedures.

     


    Surendran Anthony.


    Sounds like an ASP.NET app?

    Yes, you can add the DataSet to a Session variable and re-use/work it when in-session.  Be aware that as your DataSet grows in size and complexity, the extra overhead can cause performance hits --- one solution is to put the Ds into a generic list and save in-session.  You might also consider caching the ds in a DAL or BLL (or somewhere in the application architecture) -- this would require your app be developed as a layered or tiered design.

    http://forums.asp.net/t/1343546.aspx/1/10

    http://stackoverflow.com/questions/2323780/pitfall-of-storing-datatable10-000-rows-in-a-session-variable

     

    What exactly are your StoredProcedures doing that you need to simulate?

     


    James Crandall ~ http://javitechnologies.com Spatial Database Solutions
    • Marked as answer by Surendran08 Friday, December 2, 2011 5:43 AM
    Thursday, December 1, 2011 2:20 PM

All replies

  • I have a requirement where I need to handle a set of tables with some smaller number of rows.

    And the chance of these rows getting updated is very low, So I dont want to visit the database now and then. But still I want the data in the database.

    Now is it possible/recommended to load all theses tables in the application session state as a DataSet and operate on it.

    And there are some stored procedures which or operate on this tables. How can i stimulate the functions of those stored procedures.

     


    Surendran Anthony.


    Sounds like an ASP.NET app?

    Yes, you can add the DataSet to a Session variable and re-use/work it when in-session.  Be aware that as your DataSet grows in size and complexity, the extra overhead can cause performance hits --- one solution is to put the Ds into a generic list and save in-session.  You might also consider caching the ds in a DAL or BLL (or somewhere in the application architecture) -- this would require your app be developed as a layered or tiered design.

    http://forums.asp.net/t/1343546.aspx/1/10

    http://stackoverflow.com/questions/2323780/pitfall-of-storing-datatable10-000-rows-in-a-session-variable

     

    What exactly are your StoredProcedures doing that you need to simulate?

     


    James Crandall ~ http://javitechnologies.com Spatial Database Solutions
    • Marked as answer by Surendran08 Friday, December 2, 2011 5:43 AM
    Thursday, December 1, 2011 2:20 PM
  • What exactly are your StoredProcedures doing that you need to simulate?

     


    James Crandall ~ http://javitechnologies.com Spatial Database Solutions

    Thanks James.

    The stored procedures have some lookup operations with small arithmetic. 


    Surendran Anthony.
    Thursday, December 1, 2011 4:48 PM
  • What exactly are your StoredProcedures doing that you need to simulate?

     


    James Crandall ~ http://javitechnologies.com Spatial Database Solutions

    Thanks James.

    The stored procedures have some lookup operations with small arithmetic. 


    Surendran Anthony.


    Well, if the lookups are fairly simple and between DataTables contained in your DataSets then you could probably get away with .Select statments on them directly.

    http://msdn.microsoft.com/en-us/library/det4aw50.aspx

    Keep in mind though that this is not really for implementing complex Transact-SQL.


    James Crandall ~ http://javitechnologies.com Spatial Database Solutions
    Thursday, December 1, 2011 5:31 PM
  • Thats Fine.

    It Will be helpful for me , If you advice how could complex Transact SQL's can be implemented.


    Surendran Anthony.
    Friday, December 2, 2011 5:41 AM
  • Thats Fine.

    It Will be helpful for me , If you advice how could complex Transact SQL's can be implemented.


    Surendran Anthony.


    You could actually use the SProcs (requires another connection and data transfer process to occur).  Or you could implement LINQ or EntityFramework (I think).

    http://msdn.microsoft.com/en-us/library/bb308959.aspx

    http://weblogs.asp.net/scottgu/archive/2007/05/19/using-linq-to-sql-part-1.aspx

     


    James Crandall ~ http://javitechnologies.com Spatial Database Solutions

    Friday, December 2, 2011 12:34 PM