 |
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
|
|
|
|
|

November 6th, 2009, 10:59 AM
|
|
Authorized User
|
|
Join Date: Nov 2009
Posts: 14
Thanks: 4
Thanked 0 Times in 0 Posts
|
|
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
|
|

November 6th, 2009, 12:36 PM
|
|
Authorized User
|
|
Join Date: Mar 2009
Posts: 79
Thanks: 4
Thanked 4 Times in 4 Posts
|
|
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:
|
|
|

November 9th, 2009, 12:47 PM
|
|
Authorized User
|
|
Join Date: Nov 2009
Posts: 14
Thanks: 4
Thanked 0 Times in 0 Posts
|
|
Hi,
That's worked fine. Thanks for your help
|
|

November 9th, 2009, 01:04 PM
|
|
Authorized User
|
|
Join Date: Mar 2009
Posts: 79
Thanks: 4
Thanked 4 Times in 4 Posts
|
|
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:
|
|
|

November 9th, 2009, 03:54 PM
|
|
Authorized User
|
|
Join Date: Nov 2009
Posts: 14
Thanks: 4
Thanked 0 Times in 0 Posts
|
|
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
|
|

November 9th, 2009, 04:29 PM
|
|
Authorized User
|
|
Join Date: Mar 2009
Posts: 79
Thanks: 4
Thanked 4 Times in 4 Posts
|
|
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.
|
|

November 10th, 2009, 11:15 AM
|
|
Authorized User
|
|
Join Date: Nov 2009
Posts: 14
Thanks: 4
Thanked 0 Times in 0 Posts
|
|
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
|
|

November 11th, 2009, 10:33 AM
|
|
Authorized User
|
|
Join Date: Nov 2009
Posts: 14
Thanks: 4
Thanked 0 Times in 0 Posts
|
|
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
|
|
 |