Click here to Skip to main content
14,492,702 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hi Guys

I would like to know what would be the best practice in .net for the following

I currently have a .net application which i am busy with and just would like to know what would be the best practice of handling the data.

Currently on page load i have some data that gets loaded into a datatable which is used as the datasource for a datagrid.

in the grid there is a link which the user clicks which redirects them to a calculation page and once completed on the calculation page, the application redirects to the previous page and i pass the calculation back to the previous page through a datatable in a viewstate.

Is this the best way or is there a better way of handling this?

What I have tried:

currently i pass a session variable which holds a uniqueId for the row being updated, to the calculation page once the calculation is done i have a viewstate which holds a datatable with the uniqueid and update the fields in the datatable and on redirect do a select on the viewstate datatable to see if the data exists for the rowId = uniqueid and update the columns in the datagrid if there is data
Posted
Updated 10-Jul-17 20:32pm

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

The solution is fine. Memory managment gets only a problem, when the loaded data gets to big. First hints is: when it gets slower than normal.

If you want to preserve memory than check that you arent copying data around. Compute once and store the results in class data members. Miminize log and debug output.

Consider closing the db-connection after fetching the data. This is good resource managment.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100