使用强对象查询Radgrid中的数据 [英] Querying data in a Radgrid using strong object

查看:113
本文介绍了使用强对象查询Radgrid中的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好。我有一个查询数据的应用程序。我有数据字段FirstPhase,Second Phase,ThirdPhase.All那些是不同日期的形式,每个不同的25天。首先我查询帐户类型获取这些帐户类型的列表后,我填充了我的网格。返回的结果有第一阶段以及第二和第三阶段。



我需要查询返回的基于这些帐户类型的数据,当我选择firstPhase或第二或第三阶段时,我查询当前在grid.Am中的数据如何做到这一点。使用linq到sql.Here是我正在尝试的代码。 br $>


Hello all.I have an application which am querying data on it.I have datafields column FirstPhase,Second Phase,ThirdPhase.All those are in form of different dates each with a difference of 25 days.First i am querying account types.After getting the list of those account types,am populating my grid.The returned results have first phase and also second and third phase.

I need to query the returned data based on those account types such that when i select firstPhase or second or third phase,i query that data currently in grid.Am stuck their on how to do that.Am using linq to sql.Here is a code i was trying.

var query = db.accounts.Where(a => a.accountType== accountType).ToList();
            return query.ToList();





返回这里列出了帐户类型,当我返回时,返回的数据有FirstPhase,SecondPhase,ThirdPhase。



那么,我可以做一个基于查询的查询吗?在那些日期。我被困在这里。

谢谢



Am returning a list here of the account types,when i return that,the returned data has those FirstPhase,SecondPhase,ThirdPhase.

So,is it possible i do a query based on those dates.Am stuck here.
Thanks

推荐答案

var query = db.accounts.Where(a => a.accountType== accountType).ToList();
return query.ToList();







var query = db.accounts.Where(a => a.accountType== accountType).ToList();
// additional predicates, as needed
query = query.Where(a => a.FirstPhase >= '1/1/2001' && a.FirstPhase <= '12/12/2001');

return query.ToList();


这篇关于使用强对象查询Radgrid中的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆