1

I'm binding this Entity framework query to a gridview and is ultra slow. The delay is on databinding. Any solution?

Using ctx As New DBEntities()

Dim PROC= (From p In context.Table.Include("RELATION") _ Where p.KEY= 1 _ Select p).First()

Dim q1 = From r In PROC.relation _ Select New With { _ r.key, _ r.field}

grdView.DataSource = q1 grdView.DataBind()

user285677
  • 1,098
  • 3
  • 14
  • 21
  • Profile your application. Probably nothing happens at all until you data bind. When you data bind, the LINQ tree is compiled into an ADO Canonical Command Tree, SQL is generated, SQL is executed, binding is set up, and results are fetched. *Any* of that could potentially be slow. Your first stop with performance issues is the profiler. – Craig Stuntz Mar 03 '10 at 20:13
  • Have the same problem http://stackoverflow.com/questions/2788215/slow-databinding-setup-time-in-c-net-4-0 – Svisstack May 10 '10 at 14:04

0 Answers0