Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here's a low tech solution. It doesn't require use of web services or any other additional technologies.</p> <p><strong>Step 1</strong></p> <p>Have an ASPX page that takes one paramter, and invoked like this:</p> <pre><code>http://mysite.com/query.aspx?sql=select * from orders where status = 'open' </code></pre> <p><strong>Step 2</strong></p> <p>In the code behind, do something like this</p> <pre><code>void Page_Load(object sender, EventArgs e) { Response.ContentType="text/json"; DataTable contents = ExecuteDataTable(Request["sql"]); Response.Write( JRockSerialize( contents ) ); Response.End(); } </code></pre> <p>You can use <a href="http://jayrock.berlios.de/" rel="nofollow noreferrer">JRock</a> for serializing a data table to JSON. IMHO this gives the cleanest JSON. </p> <p>So that's getting <code>DataTable</code> to JSON sorted...</p> <p><em>WARNING: This is obviously a simplistic example. You shouldn't pass SQL on the query string as it is not secure (your could use named queries and parameters instead).</em></p> <p><strong>Step 3</strong></p> <p>In your ExtJS code, create a grid with Json datastore as shown in this <a href="http://www.extjs.com/deploy/dev/examples/grid/binding.html" rel="nofollow noreferrer">Ext example</a>. Set the data store <code>url:</code> to that of your query.aspx page with appropriate query string parameters. </p> <p>You'll also need to set the columns up for the grid, again shown in the ExtJs example.</p> <p><strong>Alternatively...</strong></p> <p>I was really impressed when I looked at the <a href="http://www.coolite.com/" rel="nofollow noreferrer">Coolite samples</a> recently. They are an ExtJS partner and provide a good ASP.NET &amp; ExtJS experience. And no, I don't work for them :) I haven't tried their grid, but it might be painless (at a price).</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload