Web服务调用sql存储过程 [英] Web service to call sql stored procedure

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

问题描述

我不知道这是否是论坛的正确部分。但是......我整晚都在努力创建一个Web服务来调用sql server 2008中的存储过程。存储过程将链接服务器调用到db2数据库,该数据库接受1个整数并返回6个变量。


最终结果是将Web服务发布到我们的sharepoint服务器。这不是问题。


我只是想绕过它。我知道如何在桌面应用程序中使用vb.net调用存储过程,只是在转换到Web服务以调用该存储过程时遇到问题。


大多数搜索都试图调用a来自存储过程的Web服务,但我想做相反的方式,Web服务来调用存储过程。


建议?感谢您的帮助。

I don''t know if this is the right part of the forum. But.... I have been working all night trying to create a web service to call a stored procedure in sql server 2008. The stored procedure calls a linked server to a db2 database that accepts 1 integer and returns 6 variables.

The end result would be publish the web service to our sharepoint servers. This is not a problem.

I am just trying to wrap my head around it. I know how to call the stored procedure using vb.net in a desktop app, just having problems transitioning to a web service to call that stored procedure.

Most searching finds trying to call a web service from a stored procedure, but I want to do the other way around, web service to call stored procedure.

Suggestions? Thanks for the help.

推荐答案

从Web应用程序或Web服务调用存储过程或Windows服务没有区别...过程相同....你需要连接字符串,命令对象和其他常规事物....
There is no difference in calling a stored procedure from web app or web service or for that matter windows service... The procedure is same .... You need connection string , command object and other regular things....


我让web服务工作.....部分。


我可以通过我的输入变量,但我只返回一个变量。我尝试了一个类或一个结构,但没有去。


我的输入是一个整数(intEmployeeID),我的输出是字符串(strFName),字符串(strLName),整数(intAnnual) ,整数(intSick)和其他几个。


对此有何建议?


谢谢。
well i got the webservice to work.....partially.

I can pass my input variable,but I only get one variable back. I tried a class or a structure, but no go.

My input is an integer (intEmployeeID) and my outputs are string(strFName), string(strLName), integer (intAnnual), integer (intSick) and a couple other.

Suggestions on this?

Thanks.


使用 SqlParameters 方向为outparameters的输出

Use SqlParameters with Direction as Output for outparameters

展开 | 选择 | W rap | 行号


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

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