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 March 12th, 2009, 11:32 AM
Registered User
 
Join Date: Mar 2009
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
Default Three New Methods not added

I've been doing good up to the point where we create the data content. I add the ENTUserAccount to the ORM designer. On page 26 it says 3 new methods were added to the Extensibility Method Definitions. I do not get any additional method definitions. I've remove the table and placed is back in the designer, no luck. Any suggestions, Obviously a new person to ASP Net and Visual Studio, just trying to self-learn.
 
Old March 12th, 2009, 06:23 PM
Wrox Author
 
Join Date: Jan 2009
Posts: 73
Thanks: 0
Thanked 7 Times in 7 Posts
Default #region Extensibility Method Definitions

if you expand the Extensibility Method Definitions region in the HRPaidTimeOff.designer.cs file you should see the following code.

#region Extensibility Method Definitions
partial void OnCreated();
partial void InsertENTUserAccount(ENTUserAccount instance);
partial void UpdateENTUserAccount(ENTUserAccount instance);
partial void DeleteENTUserAccount(ENTUserAccount instance);
#endregion

These are the methods the book is referring to.

Let me know if this helps,
Vince
 
Old March 12th, 2009, 10:19 PM
Registered User
 
Join Date: Mar 2009
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Yes, I see what the book says, that is not what I am seeing. there is only the
Code:
partial void OnCreated();
Ed
 
Old March 13th, 2009, 10:10 AM
Wrox Author
 
Join Date: Jan 2009
Posts: 73
Thanks: 0
Thanked 7 Times in 7 Posts
Default

hmmm... this is a strange one. I created a brand new project and added a LINQ To SQL item, dragged the ENTUserAccount table on the ORM designer and it created the 3 partial methods in the code behind as expected. I tried this using VS 2008 pre SP1 and also with SP1 and both worked the same.
What is the build number for VS? It's in the Help - About Microsoft Visual Studio screen.
 
Old March 13th, 2009, 06:24 PM
Registered User
 
Join Date: Mar 2009
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
Default

I have VS 2008 version 9.0.30729.1 SP
Net Framework version 3.5 SP 1
 
Old March 14th, 2009, 08:38 AM
Wrox Author
 
Join Date: Jan 2009
Posts: 73
Thanks: 0
Thanked 7 Times in 7 Posts
Default

That's the same version I'm using.

The only way I was able to repeat this was to add a second LINQ to SQL file and drag the ENTUserAccount table on that file. The second file did not have the three partial methods. Do you already have a LINQ to SQL file in your project with the ENTUserAccount table?
 
Old March 16th, 2009, 06:31 PM
Registered User
 
Join Date: Mar 2009
Posts: 1
Thanks: 0
Thanked 1 Time in 1 Post
Smile possible solution

Check to see if you've set the primary key in the database. I made that mistake, and the result was a lot like what you described!
The Following User Says Thank You to theWalrus For This Useful Post:
edgay54 (March 17th, 2009)
 
Old March 17th, 2009, 03:46 PM
Registered User
 
Join Date: Mar 2009
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Your are exactly right! Addiig a primary key did the trick, now if the book had said that I'd be ahead by at least 3 weeks...
 
Old March 17th, 2009, 04:18 PM
Authorized User
 
Join Date: Mar 2009
Posts: 79
Thanks: 4
Thanked 4 Times in 4 Posts
Default

I too had this problem when I first started and setting the primary key resolved it for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Where should the tax be added? Rachel BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 0 March 7th, 2009 02:59 AM
I added a column to a table, but, I can't see it. furjaw SQL Language 1 July 3rd, 2007 09:24 PM
UserControls can be added in datagridTextBoxColumn HemaChaudhry VB.NET 6 October 29th, 2006 10:30 PM





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