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 April 10th, 2009, 11:17 PM
Authorized User
 
Join Date: Apr 2009
Posts: 41
Thanks: 1
Thanked 2 Times in 2 Posts
Default ENTWFOwnerGroupData.IsNameUnique

Here I get to demonstrate my laughable understanding of Linq...

I added an owner to a workflow I created. That worked fine. Then I went back to edit the description, and got the "The name must be unique." error.

I took a look at ENTWFOwnerGroupData.IsNameUnique, to see what it was returning:

return (result.Single().CountOfNames == 0);

Shouldn't that line actually be return (result.Single().CountOfNames <= 1);?

Otherwise any update on an existing owner will fail.

Unless there's something else I'm missing?

Thanks.

Tim
 
Old April 10th, 2009, 11:23 PM
Authorized User
 
Join Date: Apr 2009
Posts: 41
Thanks: 1
Thanked 2 Times in 2 Posts
Default

I should have ran one more test - adding a new owner with an existing name.

That one crashed the program (violation of the unique constraint on the table's index) - because the IsNameUnique test returned true.

Now that I've shown my ineptitude :) - any ideas on what's going wrong in my code?

Thanks.

Tim
 
Old April 11th, 2009, 07:07 PM
Authorized User
 
Join Date: Apr 2009
Posts: 41
Thanks: 1
Thanked 2 Times in 2 Posts
Default

Ok...finally figured out the problem.

I was really confused as to why the ENTWFOwerGroupSelectCountByNameWorkflowId had ENTWFOwnerGroupId as a parameter, until I compared my version of the stored proc with Vince's.

My version had ENTWFOwnerGroupId = @ENTWFOwnerGroupId in the WHERE clause.

Vince's version had ENTWFOwnerGroupId <> @ENTWFOwnerGroupId.

I fixed my proc and it now works as advertised.

I hate simple mistakes like that....

Tim









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