views:

26

answers:

2

Hi all, I have an ASP.NET page which contains a large number of gridviews, which contain masses amount of data which take a fair while to rebind. I currently have it set so the gridviews are only bound when the account number is changed (on the page, the user searches for an account which then displays their information).

I'd like it to be able to monitor a database table (hashing it maybe?) every few minutes, then if there are changes spawn a popup box informing them, and an option to have the gridviews refreshed.

Firstly, is this possible in ASP.NET/C#? Secondly, what would the performance impact be on the page checking the hash/checking for changes in a large DB table?

Thanks

A: 

If you are using SQL-Server (you did not precise which DB you are using), have a look at SQLDependency.

GôTô
+1  A: 

Firstly, is this possible in ASP.NET/C#?

It's possible to periodically check for updates, and there are more than one ways to do it:

  • Pooling for changes - Periodically checking for changed data, by using rowversions, timestamps, other change tracking mechanism like SQL Server Change tracking
  • Getting notifications for changes - By using a change notification mechanism like Service Broker, or SqlDependency

Secondly, what would the performance impact be on the page checking the hash/checking for changes in a large DB table?

The performance impact depends heavily on the DB model, the chosen mechanism, the volume of updates etc.

You can have a very robust and fast change tracking system by using the proper technologies that fit your application requirements, or you can have a very slow and heavy tracking system by not doing so.

It all depends on the data model, the way change tracking is done, (the fastest solution for your data shape should be chosen), the amount of database updates and concurrency, the volume of updated data. Etc.

My suggestion is to experiment with different change tracking mechanisms, do some tests, read about alternatives etc, and in the end chose the right solution for your application.

Pop Catalin