|
 |
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
|
 |
|
|
 |

August 29th, 2007, 03:44 PM
|
Authorized User
|
|
Join Date: Jun 2006
Location: Chelmsford, MA, USA.
Posts: 85
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
GridView Performance
Hi,
I am using following method to fill Gridview. The performance is too slow. What is the best way to fill GridView to increase performance.
Dim cmd As OracleCommand, dt as new datatable
cmd = dbCommand(conn, sSql)
Dim a As New OracleDataAdapter(cmd)
Dim dt As New DataTable
a.Fill(dt)
GridView.DataSource = dt
GridView.DataBind()
Any help is appreciated.
Thanks
__________________
Rams
|

August 30th, 2007, 08:12 AM
|
Friend of Wrox
|
|
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
|
|
hi there.. the method you are using is the correct.. what do you mean by slow?? if you try to fill the grid with a lot of data it will be slow...
HTH
Gonzalo
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========
|

August 30th, 2007, 09:28 AM
|
Authorized User
|
|
Join Date: Jun 2006
Location: Chelmsford, MA, USA.
Posts: 85
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
yes, filling 10k rows and pagesize is 20 and when user click on page 2, 3, 4 and so on, its taking time to fill 10k rows in datatable and to grid.
Is there any best method for this, i mean instead of filing 10k rows each time when user click on each page.
Is datareader is faster than datatable? Infact, i don't need datatable to populate grid. Can we populate grid using datareader? Is it faster than datatable?
Thanks
|

August 30th, 2007, 09:33 AM
|
Friend of Wrox
|
|
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
|
|
is paging enabled on the grid?? then is not filling all the records on the grid, only the actual page.. so maybe there is other things that made the page slow??
HTH
Gonzalo
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========
|

August 30th, 2007, 09:50 AM
|
Wrox Author
Points: 13,255, Level: 49 |
|
|
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
|
|
I had a similar situation to this although my total record count was 68K rows. In my particular situation I was working with Client Data so was able to circumvent this problem by setting up a 'Tab' type system so that the grid loaded clients whose last name began with A, B, C, D etc based upon which tab was clicked.
What I might first suggest is see if it is the amount of data you are trying to bring forward or if you have some other on page elements working against you. So execute a query that will only return you, say, 50 rows of data from your entire result set. If this speeds things up you are simply loading to much data into the grid for it to be effecient.
If this does not speed things up you have something else that is slowing you down.
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for:
Professional Search Engine Optimization with ASP.NET
Professional IIS 7 and ASP.NET Integrated Programming
================================================== =========
|

August 30th, 2007, 09:51 AM
|
Authorized User
|
|
Join Date: Jun 2006
Location: Chelmsford, MA, USA.
Posts: 85
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
you r correct, paging is enabled.
I observed that its taking time to fill datatable.
Instead of loading data in datatable, can we load grid from datareader? Is that fast?
|
Thread Tools |
Search this Thread |
|
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |