Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | 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 Display Modes
  #1 (permalink)  
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.
  #2 (permalink)  
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
  #3 (permalink)  
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
  #4 (permalink)  
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.
  #5 (permalink)  
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
  #6 (permalink)  
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?
  #7 (permalink)  
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)
  #8 (permalink)  
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...
  #9 (permalink)  
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.
 


Thread Tools
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
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 01: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 09:30 PM



All times are GMT -4. The time now is 03:06 PM.


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