在查询生成器中使用控件 [英] Use a control in query builder

查看:77
本文介绍了在查询生成器中使用控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用查询生成器从数据库中获取数据,但是输入参数将来自控件,因此我们如何在查询生成器中指定控件,请您提供执行该语法的语法

I am using the query builder to to fetch data from the database, but the input parameter will be from a control so how can we specify a control in the query builder can you please provide in the syntax for doing that

推荐答案

.NET Framework 4.0中提供了查询构建器方法
要对其使用控件,请像这样使用它:
Query builder method is available in .NET Framework 4.0
To use control with it, use it like this:
ObjectQuery<Product> productQuery =
    context.Products
    .Where("it.StandardCost > @cost", new ObjectParameter("cost", Textbox1.Text));



您可以在@ http://msdn.microsoft.com/zh-CN/library/上查看详细信息bb896238.aspx#Y626 [ ^ ]



You can see the detail @ http://msdn.microsoft.com/en-us/library/bb896238.aspx#Y626[^]


这篇关于在查询生成器中使用控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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