473,386 Members | 1,699 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

System.Collections.Generic.List

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
Mar 27 '07 #1
1 2603
"Kuldeep" <ku****************@hotmail.comwrote in message
news:Os**************@TK2MSFTNGP06.phx.gbl...
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?
Your List is indeed a snapshot of the database at the time that you
performed the query, so you won't see the changes that other users make to
the database after you took your snapshot. If you want to see those changes,
you will need to requery the database and load the new data into the List.
You could do that by repeatedly polling the database, but if the server is
Sql Server 2005, there is a better way: You can create a SqlDependency
object, and be notified in the OnChange event of the changes to the
database.
http://msdn2.microsoft.com/en-us/lib...ependency.aspx
Mar 27 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Softer | last post by:
Hi I have been installed Longhorn, alfa version from PDC 2003. I tryed to install Visual Studio 8.0 "Whidbey", version Beta March 2004, under Longhorn and doesen't work. : I instaled Whidbey under...
3
by: Abhi | last post by:
In the following hypothetical example I want to build a generic list of unique string items. How should I implement the pred function so that it returns true/false if target string exists in the...
2
by: ljlevend | last post by:
I've noticed that in VS.NET 2.0 Beta 1 that none of the methods in System.Collections.Generic.List are overridable. In my app I currently have over 50 strongly typed ArrayLists that inherit from...
6
by: Arthur Dent | last post by:
How do you sort a generic collection derived from System.Collections.ObjectModel.Collection? Thanks in advance, - Arthur Dent
2
by: newscorrespondent | last post by:
I have a list declared: public System.Collections.Generic.SortedList<int, System.Collections.Generic.List<MTGTracer ActiveList = new SortedList<int,List<MTGTracer>>(); The key is an integer...
6
by: Mark Rae | last post by:
Hi, I'm in the process of updating an ASP.NET v1.1 web app to v2. The app uses ActiveDirectory a great deal, and I'm trying to use the new System.Collections.Generic namespace where possible,...
2
by: Fred Heida | last post by:
Hi, i'm trying to (using managed C++) implment the IEnumerable<Tinterface on my class.. but have a problem with the 2 GetEnumerator method required.... what i have done is... ...
0
by: DR | last post by:
System.Collections.Generic.List<intmyList = new System.Collections.Generic.List<int>(100); Does this preallocate 100 integers? Also, is there any way to preallocate an array of objects all at...
2
by: Fred Mellender | last post by:
I am trying to use reflection to output the fields (names and values) of an arbitrary object -- an object dump to a TreeView. It works pretty well, but I am having trouble with generic lists,...
2
by: SimonDotException | last post by:
I am trying to use reflection in a property of a base type to inspect the properties of an instance of a type which is derived from that base type, when the properties can themselves be instances of...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.