Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 6th, 2009, 10:59 AM
Authorized User
 
Join Date: Nov 2009
Posts: 14
Thanks: 4
Thanked 0 Times in 0 Posts
Default Chapter 5

Hi All,

Working my way through the book and I've come across a problem trying to implement the Exception Handling.

Page 129, editing the registry and adding ASPNET as a user for the eventlog, well, ASPNET does not exist as a user. I have Windows 7 Ultimate, VS 2008 Standard, SQL 2005 Exp, IIS7 with IIS6 bits installed.

I have run aspnet_regsql and used the same db as my solution, have also run aspnet_regiis to ensure that is all ok too.

Any direction would be greatfully received.

Gilbo
  #2 (permalink)  
Old November 6th, 2009, 12:36 PM
Authorized User
 
Join Date: Mar 2009
Posts: 79
Thanks: 4
Thanked 4 Times in 4 Posts
Default

I think with windows 7 you might want to try adding the
NT AUTHORITY\NETWORK SERVICE instead. Let me know what happens.
The Following User Says Thank You to ZeroFactorial For This Useful Post:
Gilbo79 (November 6th, 2009)
  #3 (permalink)  
Old November 9th, 2009, 12:47 PM
Authorized User
 
Join Date: Nov 2009
Posts: 14
Thanks: 4
Thanked 0 Times in 0 Posts
Default

Hi,

That's worked fine. Thanks for your help
  #4 (permalink)  
Old November 9th, 2009, 01:04 PM
Authorized User
 
Join Date: Mar 2009
Posts: 79
Thanks: 4
Thanked 4 Times in 4 Posts
Default

Glad it worked out for you. Let me know if I can be of more assistance.
The Following User Says Thank You to ZeroFactorial For This Useful Post:
Gilbo79 (November 9th, 2009)
  #5 (permalink)  
Old November 9th, 2009, 03:54 PM
Authorized User
 
Join Date: Nov 2009
Posts: 14
Thanks: 4
Thanked 0 Times in 0 Posts
Default

Hi,

I have progressed to Chapter 6 and am getting the following error when building

Error 1 'XXX.XxxDAL.XxxDataContext' does not contain a constructor that takes '0' arguments C:\Users\Andrew\Documents\Visual Studio 2008\Projects\Xxx.net Solution\XXX.XxxBLL\Framework\ENTBaseEOList.cs 29 55 XXX.XxxBLL

Which refers to:
Code:
public bool Save(ref ENTValidationErrors validationErrors, int userAccountId)
        {
            // Check if this object has any items
            if (this.Count > 0)
            {
                using (TransactionScope ts = new TransactionScope())
                {
                    using (XxxDataContext db = new XxxDataContext())
                    {
                        if (this.Save(db, ref validationErrors, userAccountId))
                        {
                            // Commit transaction if update was successful
                            ts.Complete();
                            return true;
                        }
                        else
                        {
                            return false;
                        }
                    }
                }
            }
            else
            {
                //No items in the list so return true.
                return true;
            }
        }
The second datacontext in the second using line is what is underlined...

Any advice on this, greatly accepted

Gilbo
  #6 (permalink)  
Old November 9th, 2009, 04:29 PM
Authorized User
 
Join Date: Mar 2009
Posts: 79
Thanks: 4
Thanked 4 Times in 4 Posts
Default

Post your DAL and BLL for this Save. My first thought is that BLL EO item contains a Save method that passes nothing in. At minimum it has to pass in the DataContext, ref Validation and ENTUserAccountId.


Sample BLL
Code:
 
// Notice this is the same method that is referenced in the ENTEOList object
publicoverridebool Save(HRPaidTimeOffDataContext db, refENTValidationErrors validationErrors, int userAccountId)
{
if (DBAction == DBActionEnum.Save)
{
//Validate the object
Validate(db, ref validationErrors);
//Check if there were any validation errors
if (validationErrors.Count == 0)
{
if (IsNewRecord())
{
//Add
ID = newAETransferData().Insert(db, ENTUserAccountId)
//this is where your code is failing...I think :)
//Try making sure you have db and ENTUserAccountId as your first two items. 
  #7 (permalink)  
Old November 10th, 2009, 11:15 AM
Authorized User
 
Join Date: Nov 2009
Posts: 14
Thanks: 4
Thanked 0 Times in 0 Posts
Default

Hi,

I've tried ENTUserAccountId as the first item after db in ENTRoleEO and ENTUserAccountEO I get another error, stating that:

Error 2 The name 'ENTUserAccountId' does not exist in the current context C:\Users\Andrew\Documents\Visual Studio 2008\Projects\Xxx.net Solution\XXX.XxxBLL\Framework\ENTUserAccountEO.cs 46 66 XXX.XxxBLL


Code:
if (IsNewRecord())
                    {
                        //Add
                        ID = new ENTUserAccountData().Insert(db, WindowsAccountName, FirstName, LastName, Email, IsActive, userAccountId);
                    }
                    else
                    {
                        //Update
                        if (!new ENTUserAccountData().Update(db, ID, WindowsAccountName, FirstName, LastName, Email, IsActive, userAccountId, Version))
                        {
                            UpdateFailed(ref validationErrors);
                            return false;
                        }
                    }
The error applies to both EO files
  #8 (permalink)  
Old November 11th, 2009, 10:33 AM
Authorized User
 
Join Date: Nov 2009
Posts: 14
Thanks: 4
Thanked 0 Times in 0 Posts
Default

Hi,

I think I fixed it in the ENTBaseEOList.cs

Code:
using (XxxDataContext db = new XxxDataContext(DBHelper.GetXxxConnectionString()))
The BLL build fine with no errors but I get the following when building the whole solution:

1)
c:\Windows\Microsoft.Net\Framework\v2.0.50727\Temp orary ASP.Net\exporteaseui\de04c89b\8edfadb3\App_Web_lkq i3yjb.0.cs(14):error CS0534: 'ErrorPage' does not implement inherited abstract member

2)
'ErrorPage' does not implement inherited abstract member 'BasePage.capabilityNames()'

in file App_Web_lkqi3yjb.0.cs line 14

which is

Code:
public partial class ErrorPage : System.Web.SessionState.IRequiresSessionState {


Gilbo
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 6 - Code Download Missing for this Chapter dbaechtel BOOK: Professional SharePoint 2007 Development ISBN: 978-0-470-11756-9 0 August 11th, 2009 11:02 AM
Chapter 2 - End of chapter exercises whizzkid1892 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 July 30th, 2008 12:02 PM
Generics chapter 12 difficult chapter i found ...? Larryz C# 2005 1 July 4th, 2007 09:40 PM



All times are GMT -4. The time now is 12:53 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.