返回值 [英] Returning a Value

查看:82
本文介绍了返回值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

先生,

抱歉,另一个问题,例如我有此存储过程

CREATE PROCEDURE SAMPLE

AS

RETURN 1


如何在vb.net中获得值"1"?

答案是THX ..

解决方案

在Command对象中使用ExecuteScaler方法,如下所示

  Dim  thisFetchVal  As  字符串 =  CType (cmd.ExecuteScalar(), String )


通过下面的链接

http://www.codeguru.com/columns/vb/article.php/c5155 [ ^ ]

注意:使用C#代码,请尝试更改VB


Sir,

Sorry for another question for example I have this stored procedure

CREATE PROCEDURE SAMPLE

AS

RETURN 1


how can i get the value "1" in vb.net?

THX for the answers ..

解决方案

Use ExecuteScaler method in your Command object, like below

Dim thisFetchVal As String = CType(cmd.ExecuteScalar(), String)


Go through the below link

http://www.codeguru.com/columns/vb/article.php/c5155[^]

Note: Code in C#, Try to change VB


这篇关于返回值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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