“在哪里"用linq to sql [英] "Where In" with linq to sql

查看:60
本文介绍了“在哪里"用linq to sql的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在文本框中输入关键字后,我试图为用户提供数据库表中的项目列表.我目前遇到的问题是,用户可以输入多个关键字,而我希望仅执行一次往返数据库的操作,并获得与多个关键字匹配的结果(或操作).有没有一种方法可以执行这样的任务而不必为每个关键字访问数据库?

I am trying to provide the user with a list of items in a database table upon entering keywords in a textbox. The problem i currently have is that the user can enter several keyword and i would like to be able to perform only one roundtrip to the database and get back results matchings several keywords (an OR operation). Is there a way to perform such a task without having to hit the database for every single keyword?

推荐答案

我找到了 post 为我要实现的目标提供了一个很好的解决方案.谢谢您的帮助!

I found a post that offer a pretty good solution to what I was trying to achieve. Thank you for your help!

这篇关于“在哪里"用linq to sql的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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