使用linq对象加载网格 [英] Load the grid using linq object
本文介绍了使用linq对象加载网格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经在数据库中创建了一个表,并且正在使用linq query从数据库中检索数据.现在我想在dhtmlx中使用此linq对象加载网格.
任何建议..
I have created a table in database and i am retreiving the data from the database using linq query.now i want to load the grid using this linq object in dhtmlx.
Any suggestions..
推荐答案
您还可以使用LinqDataSource
组件.将其放在页面上,设置qurey和参数,并将GridView的DataSourceID设置为该LinqDataSource.
You can also use LinqDataSource
component. Put it on page, setup qurey and parameters and set GridView''s DataSourceID to that LinqDataSource.
让我们假设您的查询是:
Let suppose your query is:
public IQueryable Records()
{
var qry=from a in table1 select a;
return qry;
}
然后:
Then:
GridView1.DataSource=Records();
GridView1.DataBind();
它将起作用.
It will work.
这篇关于使用linq对象加载网格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文