System.Collections.Generic.List

K

Kuldeep

Framework: Visual Studio 2005, ASP.NET
Programing Language: C#.NET

I am using a Generic List Collection to fetch a particular master data from
the database. Once collected, I use this Collection to bind it to a
DataGrid.
Now that I am using a Generic List Collection to populate the DataGrid, say
another user would insert a new record on to the same master data from a
different machine, the updated data (along with the lastest inserted record)
would not be available in the Generic List Collection!

How do I control this?

Please advise.

Thanks,
Kuldeep
 
C

Cowboy \(Gregory A. Beamer\)

If you want to persist this collection, you will have to save it. You can do
this in Cache or in ViewState or even in Session (if it has that long of a
life, which I doubt). You then add the record to the List when you get a
postback and save back to the database, if that is your method. You do not
have to rebind every time, although you can. The best method to follow for
this is to move the binding out of Page_Load and into a routine that can be
called from Page_Load and any postback event.

If this were a windows forms app, you would have all of this done for you,
but the stateless nature of the web means you have to wire things up.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*********************************************
Think outside the box!
*********************************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top