sql - WCF RIA Services getting the ID of inserted row -
i using wcf ria services. not using entities , direct sql's. in case stored procedures , complex types work. i've faced such problem: when use store procedure insert row,there no way automatically update id database. in case of using entity , direct sql goes well. here stored procedure:
begin -- set nocount on added prevent result sets -- interfering select statements. insert product ( [name] ,[note] ) values ( @name, @note ) select scope_identity() id end
the way solve -is reload data againg after insert.i think not idea load data, when 1 row must updated.second approach write more code new id manually sql server, believe there must better approach.
Comments
Post a Comment