Click here to Skip to main content
15,909,503 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
actually i have a procedure
SQL
alter procedure psetcontact
(

@id decimal =0 output,
@value varchar(25)
)
as 
begin
insert into contact(id,value) values (@id,@value)
set @id = @@identity
end

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
Posted
Updated 23-Apr-12 20:52pm
v2

1 solution

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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900