Tell me more ×
Code Review Stack Exchange is a question and answer site for peer programmer code reviews. It's 100% free, no registration required.

Does anyone have any techniques for listing SQL rows in an HTML table using ASP.NET and Javascript in conjunction?

Actual code would be really nice...

share|improve this question

closed as off topic by palacsint, Winston Ewert Jul 23 '12 at 23:02

Questions on Code Review Stack Exchange are expected to relate to code review request within the scope defined in the FAQ. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about closed questions here.

2 Answers

There are lots of techniques here, it really all depends on what you're looking to do and what technology you're using. One of the easiest ways, if you're using Web Forms, is to place a GridView on your page and wire it up to a SqlDataSource control.

<asp:SqlDataSource id="dsMyData" runat="server" ConnectionString="<connStr here>" SelectCommand="<SQL select code here>">
<asp:GridView id="gvMyGrid" runat="server" DataSourceID="dsMyData">

There are plenty of other options you can include with each of these controls, but those are the basics. This, of course, does not do anything with JavaScript. What is it you want the JS to be able to do?

share|improve this answer

Javascript won't help you get the data into the page. You could use either a Repeater and bind the datasource, or you could use a Gridview, or you could roll your own output using Response.Write. There a lot of options available: http://support.microsoft.com/kb/307860

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.