首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

对于映射的存储过程方法,“System.Void”不是有效的返回类型。解决方案

2012-02-19 
对于映射的存储过程方法,“System.Void”不是有效的返回类型。我通过linq to sql 类调用存储过程修改表里面的

对于映射的存储过程方法,“System.Void”不是有效的返回类型。
我通过linq to sql 类调用存储过程修改表里面的一条记录。编译都能通过,测试运行时,提示“对于映射的存储过程方法,“System.Void”不是有效的返回类型。”,这是什么情况啊?

存储过程:

SQL code
ALTER PROCEDURE [dbo].[_sp_Web_ConfirmApplicationDetailClick]  @mBillManageID    nvarchar(50)    =    NULL,    --集約_伝票管理ID 变量@mConfirmTpye    char(2)            =    NULL,    --承認区分变量@mProcessor        nvarchar(50)    =    NULL,    --処理者@mComment        nvarchar(200)    =    NULL    --コメントASBEGIN    UPDATE SAP_連携承認状態        SET 承認区分 = @mConfirmTpye,        処理日 = getdate(),        処理者 = @mProcessor,        コメント = @mComment,        Record更新日 = getdate()    WHERE 集約_伝票管理ID = @mBillManageIDEND


linq to sql 方法:

 
C# code
 [global::System.Data.Linq.Mapping.FunctionAttribute(Name = "dbo.[_sp_Web_ConfirmApplicationDetailClick]")]        public void _sp_Web_ConfirmApplicationDetailClick(            [global::System.Data.Linq.Mapping.ParameterAttribute(DbType = "NVarChar(50)")] string mBillManageID,             [global::System.Data.Linq.Mapping.ParameterAttribute(DbType = "Char(2)")] string mConfirmTpye,            [global::System.Data.Linq.Mapping.ParameterAttribute(DbType = "NVarChar(50)")] string mProcessor,             [global::System.Data.Linq.Mapping.ParameterAttribute(DbType = "NVarChar(200)")] string mComment)        {            this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), mBillManageID, mConfirmTpye, mProcessor, mComment);        }        public void ConfirmApplicationDetailClick(string BillManageID, string ConfirmType, string Processor, string Comment)        {            try            {                ItemsSearcher._sp_Web_ConfirmApplicationDetailClick(BillManageID, ConfirmType, Processor, Comment);            }            catch (System.Data.SqlClient.SqlException sqle)            {                throw (sqle);            }            catch (Exception Error)            {                throw (Error);            }        }


[解决办法]
你可以修改存储过程 将影响行数作为返回值
[解决办法]
返回值不对?

热点排行