如何将小数转换为参考小数 [英] how to convert decimal to ref decimal
本文介绍了如何将小数转换为参考小数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
实际上我有一个程序
actually i have a procedure
alter procedure psetcontact
(
@id decimal =0 output,
@value varchar(25)
)
as
begin
insert into contact(id,value) values (@id,@value)
set @id = @@identity
end
当我使用linq to sql方法调用它以插入_db.psetcontact(0,"ktm")时,然后
会出现错误,无法将小数转换为参考小数
如何转换它plz help
when i call it using linq to sql method to insert _db.psetcontact(0,"ktm") then
it arises a error cant convert to decimal to ref decimal
how to convert it plz help
推荐答案
由于您已经说过@id
是输出,因此必须在某处提供它的值-并且您不知道,而是递给它一个恒定的数值-0.
要么更改您的存储过程,要么更改为提供变量的调用.
Since you have said that@id
is an output, you have to provide somewhere for it''s value to go - and you don''t, you hand it a constant numeric value - 0.
Either change your stored procedure, or change the call to provide a variable.
这篇关于如何将小数转换为参考小数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文