|
If possible, please provide an example where an insert
statement returns the new key. Page 3 and 4 of the “Data Mapper Developer Guide”
has some rudimentary info but I have not been able to get it to work. I need to modify the .NET Tutorial Web App to support auto-key
generation when I insert a new person record. This is what I have but is not working. Please advise. PersonHelp.cs public int Insert (Person person) { int mykey = Mapper ().Insert
("Insert", person); // Insert is designed so that it can return the
new key // but we are not utilizing that feature here return mykey; } PersonHelper.xml <insert id="Insert" parameterClass="Person"> insert into
PERSON
(PER_FIRST_NAME, PER_LAST_NAME, PER_BIRTH_DATE, PER_WEIGHT_KG, PER_HEIGHT_M) values
(#FirstName#, #LastName#, #BirthDate#, #WeightInKilograms#, #HeightInMeters#) <selectKey
resultClass="int" keyProperty="id" >
SELECT @@IDENTITY AS PER_ID </selectKey> </insert> Gary P. Russo MSN IM: [EMAIL PROTECTED] |
- auto-key generation example Russo, Gary
- Re: auto-key generation example oleksa borodie
- RE: auto-key generation example Pablo López
- RE: auto-key generation example Russo, Gary
- Re: auto-key generation example oleksa borodie
- RE: auto-key generation example Pablo López
- Re: auto-key generation example Larry Meadors
- Re: auto-key generation example oleksa borodie
- RE: auto-key generation example Russo, Gary
- RE: auto-key generation example Russo, Gary

