Best Method for DataSet

V

Vivek

Hi all,
I have used a DataGrid in my ASP.Net, C# WebPage and Binded DataSet to
DataGrid in
"not IsPostBack".
I have Three DropDownList OutSide DataGrid Which act as Filters For Data in
DataGrid, When user Changes the selected item in DropDownList the data in
grid should change.
example : One DropDownList Contains all countries of records are shown in
grid, now when you select suppose "USA" only records of country "USA" are
shown.
and 3 such DropDowns are given.

now my question is how shall i put these filters to DataSet.
1> shall i Query DB for each filter and bind new DataSet to grid each time.
2> shall i use a Static DataSet and just Put Filter to DataSet.
3> shall i write DataSet to XML File and refer it each time.

give me the best solution which is not very heavy.

Thanx in advanca...

Vivek Kumbhojkar
 
M

Miha Markic [MVP C#]

Hi Vivek,

If the filter data is static then go with 2 (query database only in
!PostBack or just once for session) otherwise go with 1.
 
V

Vivek

Hello Miha Markic,

Thanx for reply apart from solution can you tell me demerits of writing
DataSet to XML File and refer it each time ?

Vivek..

Miha Markic said:
Hi Vivek,

If the filter data is static then go with 2 (query database only in
!PostBack or just once for session) otherwise go with 1.

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

Vivek said:
Hi all,
I have used a DataGrid in my ASP.Net, C# WebPage and Binded DataSet to
DataGrid in
"not IsPostBack".
I have Three DropDownList OutSide DataGrid Which act as Filters For Data in
DataGrid, When user Changes the selected item in DropDownList the data in
grid should change.
example : One DropDownList Contains all countries of records are shown in
grid, now when you select suppose "USA" only records of country "USA" are
shown.
and 3 such DropDowns are given.

now my question is how shall i put these filters to DataSet.
1> shall i Query DB for each filter and bind new DataSet to grid each time.
2> shall i use a Static DataSet and just Put Filter to DataSet.
3> shall i write DataSet to XML File and refer it each time.

give me the best solution which is not very heavy.

Thanx in advanca...

Vivek Kumbhojkar
 
M

Miha Markic [MVP C#]

Hi Vivek,

Why would you want to do something like that?
That's caching and asp.net provides better caching solutions such as
System.Web.Caching.Cache class.
However, you can use xml files if you want to.
--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

Vivek said:
Hello Miha Markic,

Thanx for reply apart from solution can you tell me demerits of writing
DataSet to XML File and refer it each time ?

Vivek..

Miha Markic said:
Hi Vivek,

If the filter data is static then go with 2 (query database only in
!PostBack or just once for session) otherwise go with 1.

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

Vivek said:
Hi all,
I have used a DataGrid in my ASP.Net, C# WebPage and Binded DataSet to
DataGrid in
"not IsPostBack".
I have Three DropDownList OutSide DataGrid Which act as Filters For
Data
in
DataGrid, When user Changes the selected item in DropDownList the data in
grid should change.
example : One DropDownList Contains all countries of records are shown in
grid, now when you select suppose "USA" only records of country "USA" are
shown.
and 3 such DropDowns are given.

now my question is how shall i put these filters to DataSet.
1> shall i Query DB for each filter and bind new DataSet to grid each time.
2> shall i use a Static DataSet and just Put Filter to DataSet.
3> shall i write DataSet to XML File and refer it each time.

give me the best solution which is not very heavy.

Thanx in advanca...

Vivek Kumbhojkar
 

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

Top