Wrox Programmer Forums
|
BOOK: ASP.NET Website Programming Problem-Design-Solution
This is the forum to discuss the Wrox book ASP.NET Website Programming: Problem - Design - Solution, Visual Basic .NET Edition by Marco Bellinaso, Kevin Hoffman; ISBN: 9780764543869
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET Website Programming Problem-Design-Solution 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 May 21st, 2004, 03:59 AM
Authorized User
 
Join Date: Apr 2004
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Default namespace problem

this has to do with chapter 5 in the accountdata and account business class. i keep on getting this errors

accountdata:
The type or namespace name 'ProcResultCodes' does not exist in the class or namespace 'sonaike.WebModules.Accounts' (are you missing an assembly reference?)

for this:

if (e.Number == 2601)
{
return (int)sonaike.WebModules.Accounts.ProcResultCodes.A ccountAlreadyOnFile;
}


accountbusiness:
 The type or namespace name 'Configuration' could not be found (are you missing a using directive or an assembly reference?)

for this:
private Configuration.ModuleSettings moduleSettings;


everything is the same as the code downloaded from website i only changed the root namespace to my project and also changed the SN key.


rrr
__________________
rrr
 
Old May 21st, 2004, 07:50 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hello,

WHat did you change the namespace to? PS, I don't have the book; could you post any relevant code?

Thanks,

Brian
 
Old May 21st, 2004, 10:01 AM
Authorized User
 
Join Date: Apr 2004
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Default

For the accountdata:

using System;
using System.Collections;
using System.Data;
using System.Data.SqlClient;

namespace sonaike.WebModules.Accounts.Data
{
    /// <summary>
    /// Summary description for User.
    /// </summary>
    public class User : sonaike.WebModules.Data.DbObject
    {
        public User(string newConnectionString): base(newConnectionString)
        { }

        public int Create(string emailAddress,
            byte[] password,
            string firstName,
            string lastName,
            string address1,
            string address2,
            string city,
            string state,
            string zipCode,
            string homePhone,
            string country)
        {
            int rowsAffected;
            SqlParameter[]
                parameters = {
new SqlParameter("@EmailAddress", SqlDbType.VarChar, 255),
new SqlParameter("@Password", SqlDbType.Binary, 20),
...................................
.............................. };

            parameters[0].Value = emailAddress;
            parameters[1].Value = password;
            parameters[2].Value = firstName;
                ..................................
                        ..................................

parameters[11].Direction = ParameterDirection.Output;

            try
            {
RunProcedure("sp_Accounts_CreateUser", parameters, out rowsAffected);
            }
            catch ( SqlException e )
            {

    if (e.Number == 2601)
        {
return (int)sonaike.WebModules.Accounts.ProcResultCodes.A ccountAlreadyOnFile;
                }
    else
    {
throw new AppException("An error occurred while executing the Accounts_CreateUser stored procedure",e );
    }
      }

    return (int)parameters[11].Value;
        }

error:
........................Modules\Accounts\ACCOUNTSD ATA\User.cs(71): The type or namespace name 'ProcResultCodes' does not exist in the class or namespace 'sonaike.WebModules.Accounts' (are you missing an assembly reference?)


.................................................. ...................

accountbusiness:


using System;
using System.Data;

namespace sonaike.WebModules.Accounts.Business
{
    /// <summary>
    /// Summary description for User.
    /// </summary>
    public sealed class User : sonaike.WebModules.Business.BizObject
    {
    private Configuration.ModuleSettings moduleSettings;
    private int userID;
    private string firstName;
    private string lastName;
    private string address1;
    private string address2;
        .......................
        ......................

error: ...............\Modules\Accounts\ACCOUNTSBUSINESS\ User.cs(11): The type or namespace name 'Configuration' could not be found (are you missing a using directive or an assembly reference?)


rrr
 
Old May 21st, 2004, 12:08 PM
Authorized User
 
Join Date: Apr 2004
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Default

finally figured it out. the method PROCRESULTS was not present where it was beign referenced. but i had to manually find where it was supposed to be because the author's NAMESPACE does not follow thier directory tree. PROCRESULT is supposed to be located in the core project has the NAMESPACE Wrox.WebModules.Accounts

rrr





Similar Threads
Thread Thread Starter Forum Replies Last Post
Namespace problem Harshal123 BOOK: Beginning XML, 4th Ed ISBN: 978-0-470-11487-2 1 October 21st, 2008 06:35 AM
namespace problem muki XSLT 1 November 13th, 2005 12:25 PM
Namespace Problem JRMotz BOOK: ASP.NET Website Programming Problem-Design-Solution 1 November 12th, 2005 03:18 PM
namespace problem marclena XSLT 1 February 12th, 2004 03:48 PM
Problem with Namespace allenracho BOOK: ASP.NET Website Programming Problem-Design-Solution 2 October 22nd, 2003 11:31 AM





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