Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > SqlDataAdepter vs Manual Data binding - Performance question.

Reply
Thread Tools

SqlDataAdepter vs Manual Data binding - Performance question.

 
 
Aykut Canturk
Guest
Posts: n/a
 
      08-06-2008
As all we know there are 2 ways for binding gridview to sql table. using
sqldata adapter and using code. What I want to know is, in large tables, is
there a perfomance difference. When using code we don't specify any page
size or anything. so all data must be retreived from sql table to web server
memory, is that right ? Maybe, only maybe, sql data adapter uses different
approach about loading table rows for perfomance issues.

in VB6, with classic ado, there were some concepts like getting some data
first and shot it to user, in grid for example, then if user scrolls down,
we get neccesseary data. also we could see this in components, after showing
data on screen, when you observe scrollbar, you could understand that data
is still loading while you work.

in classic asp we did paging, for example using IDs and pagesize commands.
but again we would load limited amount data into memory.

ado.net changed the concept and I don't understand how memory never gets
full or there is no performance issue when I open dataset into memory with
code. espescially microsoft encourage us to use multiple datasets, data
tables, disconnected recordsets,.... and all these eats up memory and
performance right ?

any explanation or suggestion wihich approach is better when working with
large tables and grids ? Or any reliable article suggestion on that ?

thanks.

 
Reply With Quote
 
 
 
 
michel.desangles@gmail.com
Guest
Posts: n/a
 
      08-07-2008
On 6 août, 11:10, "Aykut Canturk" <(E-Mail Removed)> wrote:
> As all we know there are 2 ways for binding gridview to sql table. using
> sqldata adapter and using code. What I want to know is, in large tables, is
> there a perfomance difference. When using code we don't specify any page
> size or anything. so all data must be retreived from sql table to web server
> memory, is that right ? Maybe, only maybe, sql data adapter uses different
> approach about loading table rows for perfomance issues.
>
> in VB6, with classic ado, there were some concepts like getting some data
> first and shot it to user, in grid for example, then if user scrolls down,
> we get neccesseary data. also we could see this in components, after showing
> data on screen, when you observe scrollbar, you could understand that data
> is still loading while you work.
>
> in classic asp we did paging, for example using IDs and pagesize commands..
> but again we would load limited amount data into memory.
>
> ado.net changed the concept and I don't understand how memory never gets
> full or there is no performance issue when I open dataset into memory with
> code. espescially microsoft encourage us to use multiple datasets, data
> tables, disconnected recordsets,.... and all these eats up memory and
> performance right ?
>
> any explanation or suggestion wihich approach is better when working with
> large tables and grids ? Or any reliable article suggestion on that ?
>
> thanks.


Just one point about your sentence "When using code we don't specify
any page
size or anything". I usually build my tables manually and not through
binding, but I do specify a page size and number of rows through code,
like this for instance :

SELECT ID, Name FROM (SELECT ROW_NUMBER() OVER (ORDER BY Name) AS
RowNumber, * FROM MyTable) AS Result WHERE RowNumber BETWEEN 10 AND 20

This way, you only return the rows you're interested in. Obviously,
you have to handle pagination yourself instead of relying on the
framework, but performance-wise, I'm pretty much on par with a
standard gridview binding (which, by the way, if correctly configured,
will also limit the number of rows you're working on at one point in
time). So, memory and performance aren't hampered.

PS : the code above is for SQL 2005, it was way more convoluted with
SQL 2000.

Michel
 
Reply With Quote
 
 
 
Reply

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
Xsi photo...I miss MANUAL manual settings. Nervous Nick Digital Photography 1 11-04-2008 02:38 AM
Vertical Lines on the LCD screen - Need service manual for Toshiba Laptop (not a users manual) marzdra@yahooo.con Computer Support 1 12-16-2006 09:18 PM
Complex data binding question, binding child objects of a custom collection. JcFx ASP .Net Datagrid Control 0 06-01-2005 04:01 PM
Setting up DHCP server in IOS (including manual binding) Torquil Corkerton Cisco 6 04-06-2004 09:33 PM
Data Binding - using inline code vs. functions vs. straight binding Jordan ASP .Net 2 02-10-2004 08:32 PM



Advertisments