Are there any performance benefits to me not using the gridview in asp.net for simple tables querying from a stored procedure and instead writing the html in server code myself. I'm sure my code would certainly be more concise in output.
No, there are no performance benefits with using a GridView. In general, the GridView is going to decrease a little bit of performance due to the fact that items are written into the ViewState,and additional HTML is generated. The benefits you DO get from the GridView include command events and arguments that can be easily consumed or created, a DataKey "property bag" that allows you to track critical fields in a large result set, as well as many other things. I will add this caveat that I've used GridViews on even very simple result set returns and have not seen any significant performance problems.
If you are simply doing some output from a table query, and not worrying about doing too much interaction with the data from the results itself, "rolling your own" would provide a great solution.
Well, of course it depends on your implementation. You could almost certainly build something that runs faster than the stock gridview.
The problem is, how would you know? The default system for string concatenation in .Net is by it's nature very slow, so it would be easy to accidentally build something that is much slower than the stock gridview. You could of course test things out, but the development time investment is likely to outweigh an server performance gains.
I am going to propose an alternate solution. If you don't need any of the features of a GridView, why not use a repeater.
A repeater keeps it simple for implementation, but also allows you to have full control over the generated source. Without the issue of string concatentation preformance.
I've found marginal performance improvements with repeaters over GridViews.
There's an additional possibility here that exists between using a GridView and using a StringBuilder to generate HTML. I'm talking about using the ASP Table class. I have seen impressive speed benefits on using them over a standard GridView when all I'm doing is spitting out data. As an added bonus, I can add a button (or linkbutton) to my output and wire it up with an event handler and still get the functionality of a GridView in that regard.
You'd use it thus:
Dim tab As New Table
For Each row In DataTable.Rows
Dim tabRow as New TableRow
For Each col In row.Columns
dim tabCol as New TableColumn
tabCol .Text = row(col)
tabRow.Controls.Add(tabCol )
Next
tab.Rows.Add(tabRow)
Next
Page.Controls.Add(tab)