使用asp.net4从SQL 2008数据库中搜索 [英] Searching from SQL 2008 database with asp.net4

查看:56
本文介绍了使用asp.net4从SQL 2008数据库中搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友,我的数据库"ComputerData"有一个表"ItemSet",其中包含以下字段:
int ID,nvarchar(100)PCSLNo,nvarchar(100)MonitorSLNO,nvarchar(30)位置,....

我所做的事情:客户需要在文本框中输入整个PCSLNo或MonitorSLNO,然后提交以通过与该字段相关的ListView从aspx页的表中检索信息.

我需要做的:客户端将在文本框中输入一些PCSLNo或MonitorSLNo字符串.提交后,他们将从与aspx页(通过ListView或其他合适的数据控件)中的该字段有关的表中获取全部信息.

此外,我想提到的是,我在开发项目时使用EF(带有sql2008的asp.net4)foe数据库查询,并且将所有代码都写在了aspx.cs(后面的代码)页面中.

希望有良好背景的朋友的答复/建议将很快解决我的问题.等待所有人的解决方案...非常感谢.

Dear friends, my database "ComputerData" has a table "ItemSet" with the following fields:
int ID, nvarchar(100) PCSLNo, nvarchar(100) MonitorSLNO, nvarchar(30) Location,....

What I have done: The clients need to enter the entire PCSLNo or MonitorSLNO in text boxes and submit to retrieve information from the table in aspx page through ListView pertaining to that field.

What I need to do: The clients will enter a few strings of PCSLNo or MonitorSLNo in text boxes. On submit, they will get whole information from the table pertaining to that field in aspx page (thrgough ListView or other suitable data control)

Further I would like to mention that I am using EF (asp.net4 with sql2008)foe database query in developing my project and I am writing all the codes in aspx.cs(code behind)pages.

Hope reply/suggestion from friends with excellent background will sort out my problem very soon. Waiting for solution from all...Thanks a lot.

推荐答案

我的猜测是您的问题是通配符搜索.查看在SQL查询或EF查询中使用的like运算符.
My guess would be that your problem is of wildcard search. Look into the like operator to be used in SQL queries or EF queries.


这篇关于使用asp.net4从SQL 2008数据库中搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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