Wrox Programmer Forums
|
BOOK: ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solutio
This is the forum to discuss the Wrox book ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solution by Vincent Varallo; ISBN: 9780470396865
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solutio section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 4th, 2010, 01:05 PM
Authorized User
 
Join Date: Nov 2009
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default 'Version' in where clause fails to match record

When I include the version in the where clause of a stored procedures, the record is not found for Update, select , retrieve.
The insert works fine for stored procs...but it does not contain a version.

Thanx
 
Old January 5th, 2010, 04:26 PM
Authorized User
 
Join Date: Mar 2009
Posts: 79
Thanks: 4
Thanked 4 Times in 4 Posts
Default

Can you be more specific? I think the prob you are running into is due to Version being a binary field. You would need to extract the version data to know what to search for specifically.

Provide a sample of your SP.
 
Old January 5th, 2010, 05:48 PM
Authorized User
 
Join Date: Nov 2009
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The sp and Table use a timestamp data type ...The ENTRoleCapabilityUpdate uses a binary dataType. Are your sp , table and ENTRoleCapabilityUpdate different from this?

ALTER PROCEDURE [dbo].[ENTRoleCapabilityUpdate]
(
@ENTRoleCapabilityId int,
@ENTRoleId int,
@ENTCapabilityId int,
@AccessFlag tinyint,
@UpdateENTUserAccountId int,
@Version timestamp
)
AS
SET NOCOUNT ON
UPDATE ENTRoleCapability
SET ENTRoleId = @ENTRoleId,
ENTCapabilityId = @ENTCapabilityId,
AccessFlag = @AccessFlag,
UpdateDate = GetDate(),
UpdateENTUserAccountId = @UpdateENTUserAccountId
WHERE ENTRoleCapabilityId = @ENTRoleCapabilityId
-- AND Version = @Version
 
Old January 9th, 2010, 08:58 PM
Authorized User
 
Join Date: Mar 2009
Posts: 17
Thanks: 1
Thanked 0 Times in 0 Posts
Default

I have found that the "SET NOCOUNT ON" eliminates the return of the number of rows affected. On Update and Delete Stored Procedures, the command effectively returns a False. I removed this command for update/delete stored procedures.

The Stored Procedures provided with the book uses SET NOCOUNT ON, but these SP have a "RETURN @@ROWCOUNT" as the last statement of the procedure. I noticed in the example that you provided the Return was not specified. I used the downloaded SP examples without much change.

Hope this helps.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Search and match record from two tabel delion Pro VB Databases 1 May 15th, 2007 11:51 AM
template match doesnt match the required node Tomi XSLT 2 March 12th, 2007 06:24 AM
Selecting top record of a group by clause lic023 Access 7 June 7th, 2006 11:25 AM
Insert Record Fails W/ Unique Constraint snw C# 0 September 2nd, 2005 02:14 PM
CurrentDate Comparison in Where clause fails why Raz Muhammad SQL Server 2000 4 September 28th, 2004 03:04 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.