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 March 30th, 2009, 07:25 PM
Authorized User
 
Join Date: Mar 2009
Posts: 79
Thanks: 4
Thanked 4 Times in 4 Posts
Default BLL Object Created by Code Generator

Have been working on my applied framework project for the past week without many issues.

Today I noticed that I can not access my AETransfersEO class in my UI GridEdit page.
I can see all other classes listed such as PTORequestEO, HolidayEO but the class built by the CodeGenerator does not show. The only thing remotely close is AETransfer which is my DAL object.

I have checked all of the using references they all check out. Went through PTORequestEO and my AETransfersEO, all of the using statements check out. I should not need to add any references since they have already been added in the project.

During compile I get errors saying it can not find the object AETransfersEO.

Error:
Code:
Error 8 The type or namespace name 'AETransfersEO' could not be found (are you missing a using directive or an assembly reference?)
Below is the header information for the files in question.


Quote:
AETransfersEO Header
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using V2.PaidTimeOffDAL.Framework;
using V2.PaidTimeOffDAL;
using V2.PaidTimeOffBLL.Framework;
 
namespace V2.PaidTimeOffBLL
{
#region AETransfersEO
[Serializable()]
public class AETransfersEO : ENTBaseEO
Quote:
UI aspx Page
Code:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using V2.PaidTimeOffBLL.Framework;
using V2.PaidTimeOffBLL;
using System.Collections.Generic;
using System.Drawing;
using System.Collections.Specialized;
 
public partial class AETransfer : BaseEditPage<AETransfersEO>
Notice how above it can not find the class in the UI page?
I have checked everything that I can. I am officially stomped now.

What is preventing me from seeing my class?
The only thing that I can can come up with relates to why the DAL AETransfersData class is referenced as AETransfer. However this is the only class I see in my intellisense.

Is there a trick or shortcut to seeing what my EO created class is referenced as if at all?
Should I rebuild it and do something differently? If so what?


Thanks
  #2 (permalink)  
Old March 30th, 2009, 09:38 PM
Wrox Author
 
Join Date: Jan 2009
Posts: 73
Thanks: 0
Thanked 7 Times in 7 Posts
Default

Make sure that the namespace that your generated class is in is in a using statement in the UI class. The code generator assumes you are adding a class to the V2.PaidTimeOffBLL namespace. If your BLL uses a different namespace then you need to change the namespace in your generated class.

Let me know how you make out,
Vince
  #3 (permalink)  
Old March 31st, 2009, 10:36 AM
Authorized User
 
Join Date: Mar 2009
Posts: 79
Thanks: 4
Thanked 4 Times in 4 Posts
Default Resolved.

Quote:
Originally Posted by varallov View Post
Make sure that the namespace that your generated class is in is in a using statement in the UI class. The code generator assumes you are adding a class to the V2.PaidTimeOffBLL namespace. If your BLL uses a different namespace then you need to change the namespace in your generated class.

Let me know how you make out,
Vince
Vince, thanks for the reply.
Everything that you mentioned has been checked and verified. You can see that my AETransfersEO is in the V2.PaidTimeOffBLL namespace, above and my UI page uses that namespace.

I was able to resolve this issue, after thinking about it and back tracing. Below are my notes that lead me to the solution. Some of it is relevant most of it isnt.

My Table is called AETransfers, when I add this to the ORM it gets renamed to AETransfer. I do not know why this happens.

I run the CG DAL script and it creates AETransfersData, everything compiles properly except you access the class with AETransfer. I do not know why this happens.

I run the CG DAL script and it creates AETransfersEO, everything compiles properly except I cannot access AETransfersEO outside of the BLL namespace.

In the UI level I can get to every BLL object except my newly created classes.

The reference to the BLL and DAL are stored as dll's in the compiled project and already exists. The dll's have not been modified for close to two weeks.

Let me try to remove (delete) the dll and add it back in the project.

That resolved my problem.

Hope this can help someone out.

Thanks
  #4 (permalink)  
Old March 31st, 2009, 10:56 AM
Wrox Author
 
Join Date: Jan 2009
Posts: 73
Thanks: 0
Thanked 7 Times in 7 Posts
Default

Its considered best practice to name your tables in the singular. Microsoft seems to be trying to enforce this. Plus it helps to think of a single entity as an AETransfer object and a list is an AETransfers object.
Its just a "feature" of LINQ to SQL
 


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
BLL Edit Object Class ZeroFactorial BOOK: ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solutio 3 March 25th, 2009 02:17 PM
Product code generator yogeshyl Excel VBA 1 October 3rd, 2007 10:50 AM
Code generator and some other things Hyzac BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 13 October 9th, 2006 02:06 PM
The best code documentation generator for .VS 2005 woojtii C# 2005 1 July 3rd, 2006 01:17 PM
XSLT code generator for C# asap XSLT 0 April 14th, 2006 03:54 PM



All times are GMT -4. The time now is 10:34 PM.


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