Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
135
UltraWebGrid + LINQ + A lot of data
posted

Hi,

I'm hoping to use the 8.1 release of the UltraWebGrid along with LINQ to SQL to access data but i'm finding the performance is really bad. 

I have 11,900 records in a view which when querying normally via other tools (including VS 2008) works fine.  I noticed when I switched on SQL Profiler that the UltraWebGrid made 5 identical queries back to the database.  The way I managed to deduce it was the UltraWebGrid doing this was it was consistantly this number yet when I switched to simply iterating the results and dumping them out on the page, it only made one round trip.

Are there any kind of optimisations available with the UltraWebGrid that do something like:

- Work out the number of pages of data based on the total result set and generate the associated pager based on that.

- Retrieve only the data you need for the current page.

It seems really wasteful especially with large amounts of data that the grid behaves in the way it does. Hopefully I've not yet found the optimisation I need!

Thanks

John

Parents
  • 135
    posted

    Hi,

    Just to follow up from this.  I decided to see how the same performed using SQLClient and the query was made only one time and was significantly faster so the issue appears to be LINQ related.

    Here is the System.Data.SQLClient code I used:

     SqlConnection conn = new SqlConnection(CONNECTIONSTRING);

    SqlCommand comm = new SqlCommand("Select * from MYTABLE", conn);

    SqlDataAdapter da = new SqlDataAdapter(comm);DataSet ds = new DataSet();

    da.Fill(ds);

    grid.DataSource = ds;

     

    Here is the comparative LINQ command:

    var query = from MYTABLE in dc.MYTABLE

    select MYTABLE;

    grid.DataSource = query;

     

    Thanks

    John

Reply Children
No Data