Login Skip Navigation LinksWilsonORMapper > More Procs Search
Demo Version Demo Version
Download and try for yourself a fully working demo version, including sample apps and documentation.  The only limitation is that the demo version only works inside the debugger.

PayPal Subscribe
Get It All for $50 USD:
WebPortal, ORMapper,
Source Code, All Updates
PayPal

Wilson ORMapper Examples Wilson ORMapper Examples

Mapping Configuration

Simply add the stored procedure names to the Contact entity definition:
insertSP="InsertContact" updateSP="UpdateContact" deleteSP="DeleteContact"

Assumes parameters are named the same as fields, except for @, otherwise:
Optionally add parameter="ParameterName" to the attribute definitions

Insert Stored Procedure

CREATE PROCEDURE InsertContact (
@ContactName VARCHAR(50),
@CompanyName VARCHAR(50)
) AS
INSERT INTO Contacts
( ContactName, CompanyName )
VALUES
( @ContactName, @CompanyName );
SELECT KeyField = SCOPE_IDENTITY();

Update Stored Procedure

CREATE PROCEDURE UpdateContact (
@ContactId INT,
@ContactName VARCHAR(50),
@CompanyName VARCHAR(50)
) AS
UPDATE Contacts
SET ContactName = @ContactName,
CompanyName = @CompanyName
WHERE ContactId = @ContactId;

Delete Stored Procedure

CREATE PROCEDURE DeleteContact (
@ContactId INT
) AS
DELETE FROM Contacts
WHERE ContactId = @ContactId;