1
불행히도 업데이트 쿼리 후에받은 값을 밀어 넣을 수있는 문제를 찾을 수 없습니다. 나는이 SQL 명령이 있습니다C#에서 UPDATE .. OUTPUT 값을 읽는 방법?
@"if exists (select Id from Documents where Id=3)
begin
update Documents set Modified='Jackson',ModifiedDate=(getdate()),Start= getdate(),Finish=(select dateadd(year,Termen,getdate()) from DocumentTypes where [Key]='ITO')
output deleted.FilePath as OldFile, inserted.FilePath as NewFile
where Id=3
end"
을 내가
string old = cmd.Parameters["OldFile"].value;
로 접근을 시도하지만 그것은 작동하지 않습니다 내가 다른 솔루션이 필요합니다.
경우
SqlParameter.Direction property
질문을 이해하기 쉽게 표시하고 더 설명해야합니다. –
[SqlParameter.Direction] (http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlparameter.direction (v = vs.110) .aspx) 속성을 찾으십니까? – Reniuz
(컴파일러 오류 *가 문제가 아니라면 컴파일시에 코드를 게시해야합니다.) 게시물에서'.values'는 매우 틀리며, 아마도 무의미한 탄젠트를 피하기 위해 필요한 경우 게시물을 수정하십시오.) – user2864740