Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Stored Procedure concurrency
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
Stored Procedure concurrency
Versions des environnements
Environment:
C# 2.0
OS:
Vista
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01230985
Message ID:
01230985
Vues:
69
I'M looking into the business layer generator for concurrency management with stored procedure
Their's a check box in the "business layer generator" in the data section, but it is not visible. (no code....) ???

so I get an DBConcurrencyException from the sql server with update command within the stored procedure

Can be all field or a Time stamp !!! So it look like the DataSet generator


THE ACTUAL GENERATED STORE PROCEUDRE LOOK LIKE THIS:
----------------------------------------------------
CREATE PROCEDURE [Accounting].[CustomerUpdate]
(
@CustomerCreditLimit money,
@CustomerId varchar(10),
@CustomerName varchar(100)
)
AS
SET NOCOUNT OFF;
UPDATE [Accounting].[Customer]
SET
[CustomerCreditLimit] = @CustomerCreditLimit,
[CustomerId] = @CustomerId,
[CustomerName] = @CustomerName

WHERE
(
([CustomerId] = @CustomerId)

);

SELECT
[CustomerCreditLimit],
[CustomerId],
[CustomerName]
FROM [Accounting].[Customer]
WHERE
([CustomerId] = @CustomerId)


THE IDEAL GENERATED STORE PROCEUDRE:
----------------------------------------------------
CREATE PROCEDURE [Accounting].[CustomerUpdate]
(
@CustomerCreditLimit money,
@CustomerId varchar(10),
@CustomerName varchar(100),
@OldValueCustomerCreditLimit money,
@OldValueCustomerName varchar(100))
)
AS
SET NOCOUNT OFF;
UPDATE [Accounting].[Customer]
SET
[CustomerCreditLimit] = @CustomerCreditLimit,
[CustomerId] = @CustomerId,
[CustomerName] = @CustomerName
WHERE
(
([CustomerId] = @CustomerId
and [CustomerName]=@OldCustomerName
and [CustomerCreditLimit]=@OldCustomerCreditLimit)

);

SELECT
[CustomerCreditLimit],
[CustomerId],
[CustomerName],
[CustomerNewField]
FROM [Accounting].[Customer]
WHERE
([CustomerId] = @CustomerId)




Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform