Coding approaches-which is faster?

  • Thread starter Thread starter Chad
  • Start date Start date
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?
 
Use repeater if u only want to display data....

Use datalist or datagrid if u want to update too...
 
I wager that Response.Write would probably be the fastest.

But not very maintainable :)

Cheers,

Greg
 
If you like controlling how your output looks and formats I would use
the Repeater control as Jimmy and Gerry suggest.
 
As I said, I would not recommend using it, but the question was what is the
fastest :)

Cheers,

Greg
 
You are probably right Greg. I posted my personal preference.
 

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

Similar Threads


Back
Top