Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > static DataTable as DataSource for DataGrid

Thread Tools

static DataTable as DataSource for DataGrid
Posts: n/a
I have a DataGrid on a page and the DataSource to
this DataGrid is a DataTable.This DataTable is obtained
from a static property in that class.My intention of
making this DataTable static is to prevent it from going
to the database on every postback.

On every postback I bind the datagrid to the static
DataTable.I get the data from the database and set the
static DataTable only a few conditions.

Since static property is a class property , I have the
following questions :
1.When will the static DataTable be garbage collected ?
2.If there are 2 simulataneous browser instances of this
page , will the changes in one reflect on the other ?
3.What general care has to be taken to avoid problem with
static properties ?

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sort a datatable and create a new datatable Fredrik Rodin ASP .Net 3 09-28-2007 07:28 AM
Adding a dynamic textbox control to a datagrid with Datatable datasource JC ASP .Net Datagrid Control 2 09-30-2004 06:41 PM
Create a Datatable from a SQL datatable column shema? jg ASP .Net 1 08-17-2004 09:43 PM
Casting DataTable to class inherit from DataTable =?Utf-8?B?Qmx1ZWZsb3dlcg==?= ASP .Net 0 04-02-2004 05:41 AM
Adding DataTable Rows To another DataTable J. Babe ASP .Net 1 08-15-2003 05:04 PM