views:

194

answers:

4

first way By using java script

or

second way By using Data sourse in asp.net sqldatasourse

which is taking less stress while loading the data.. into webpage

+4  A: 

It's a horrible idea to bind 10000 records into a web page. Sensible solutions do paging; i.e. they display a subset of the data and then let the user page up/down in it.

Carl Smotricz
ya.. i knew paging is there... but its for viewing ... the data.. in page mode.. but i want to bind this type of data with datagrid..by using which method. tell me which method.. i mention two method .. above.. which one is better and how.. tell me.. pls
sikender
@sikender: you need to learn the basics of working with large datasets and Ajax. You seem to be looking for an answer you can copy and paste. It takes more than a half hearted attempt to learn any technology. Pick up Ajax in Action and learn the basics, then move up to whatever framework you like.
Claude
+1  A: 

You'll probably want to page the data, depending on how you're doing it you could do it either ways, with javascript or .net sqldatasource.

if you're not concerned about users having javascript capabilities i'd use javascript to load the data for a better user experience.

here is an example on how to use the ajax:Grid to page data with no postback.

http://dotnetslackers.com/articles/ajax/ASPNETAjaxGridAndPager.aspx

John Boker
what is that javascript?
sikender
+1  A: 

In response to sikender's comment

ya.. i knew paging is there... but its for viewing ... the data.. in page mode.. but i want to bind this type of data with datagrid..by using which method. tell me which method.. i mention two method .. above.. which one is better and how.. tell me.. pls

Asynchronous javascript call may seems to be less stress since client will able able to see page partial loaded follow by its data.

rockacola
can u give me example.. of that?
sikender
+1  A: 

Why you want to bind ur datagrid by using javascript approach?

Why not using a datatable?

//some code snippet

e.g.

datatable myDt = getTheDataSourceFromDatabase();
     if(myDt != null && myDt.rows.count > 0)
{
   myDatagrid.datasource = myDt;
   myDatagrid.databind();
}

If you need asynchronous response, use Update panel.

Using javascript approach has many pitfalls

a) Clients can disable the JavaScript of the browser

b) Sql injection as you cannot use stored proc while accessing thru javascript unless you are using native ajax etc. to list a few

For this reason heavy database manipulation are done at the server-side.

Else it is better to do paging.. You don't have to bring all the records from the database at a time. Write a stored proc which will accept the start and endpage limits and will fetch the record(use row_number() function).Alternatively, use LINQ to do the same (via Take & Skip)

e.g. a) Using Take and Skip method in LINQ queries

b) Custom Paging in GridView Using LINQ

priyanka.sarkar