使用Web服务或存储过程实现搜索 [英] Implementation of search using webservice or stored procedure

查看:143
本文介绍了使用Web服务或存储过程实现搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的项目要求使用Web服务或存储过程从数据库中搜索产品,并且应在gridview中显示搜索到的数据.我该如何实施???

My project requires the implementation of search of products from database using web service or stored procedure and it should display the searched data in gridview. How can i implement it??? Help required!

推荐答案

1)创建一个存储过程,该过程使用适当的搜索参数并在数据库上执行搜索.
2)创建一个Web服务,该服务接受来自使用者的适当参数并将这些参数传递给在步骤1中创建的存储过程.以适当的格式(即JSON,XML)将从存储的proc接收到的数据返回给使用者.等)
3)创建一个其中包含GridView的WebForm.如果您选择使用ajax与Web服务通信,则可以通过后面的代码或通过javascript填充步骤2中从Web服务接收的数据.
4)回来并为实现该程序而遇到的特定问题提出特定问题.
1) Create a stored proc that takes appropriate search arguments and performs the search on your database.
2) Create a Web Service that takes appropriate arguments from a consumer and pass those arguments on to your stored proc created in step 1. Return the data received back from the stored proc back to the consumer in an appropriate format(ie. JSON, XML, etc.)
3) Create a WebForm that has a GridView in it. You can populate the data received from the Web Service in step 2 either through code behind or via javascript if you choose to use ajax to communicate with the Web Service.
4) Come back and ask specific questions around specific issues encountered as you endeavor to achieve this program.


这不是问题.存储的proc和Web服务不是二分法,您的Web服务将必须调用proc或运行SQL.无论如何,没有人可以帮助您.我们不知道您的项目有什么用.我们只能说,如果您希望网络之外的人能够搜索(不使用网页),请使用Web服务,使用存储的proc胜过在应用程序中编写SQL,并且网格视图是数据绑定的控件,它旨在显示结果.
This is not a question. A stored proc and a web service are not a dichotomy, your web service would have to call a proc or run SQL. In any case, no-one can help you. We don''t know any thing useful about your project. All we can say is, use a webservice if you want people outside your network to be able to search ( not using a web page ), using a stored proc is better than writing SQL in your app, and a grid view is a data bound control, it''s designed to show the result.


这篇关于使用Web服务或存储过程实现搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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