Coding approaches-which is faster?

C

Chad

Which is generally faster:
Using...

1) Databound controls, such as the datagrid.
2) Creating your own tables like this:
Dim MyTable as newTable
Dim MyRow as new Row
MyTable.Rows.Add(MyRow)
Dim MyCell As New Cell
MyRow.Cells.Add(MyCell)
etc...
3) Dim s as string
s = "<TABLE>
s &= "<TR>
(etc)
s &= </TABLE>
Response.Write (s)

I assume 3 is the faster but the worse to maintain.
I like method 2 because it is flexible an easy to understand.

Is databinding faster? I find the code shorter and uglier and feel that the
code is more difficuly to follow.

Is there another approach?
 
J

Jimmy

Use repeater if u only want to display data....

Use datalist or datagrid if u want to update too...
 
G

Greg Young

I wager that Response.Write would probably be the fastest.

But not very maintainable :)

Cheers,

Greg
 
W

Will Asrari

If you like controlling how your output looks and formats I would use
the Repeater control as Jimmy and Gerry suggest.
 
G

Greg Young

As I said, I would not recommend using it, but the question was what is the
fastest :)

Cheers,

Greg
 

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

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top