p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > ASP.NET and ASP > ASP.NET 3.5 > BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3
This is the forum to discuss the Wrox book Beginning ASP.NET 3.5: In C# and VB by Imar Spaanjaars; ISBN: 9780470187593

Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 6th, 2009, 11:01 AM
Registered User
Points: 12, Level: 1
Points: 12, Level: 1 Points: 12, Level: 1 Points: 12, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 13 - Cannot insert explicit value for identity column in table 'Picture' when

Hello,
I got this error in chapter 13
Cannot insert explicit value for identity column in table 'Picture' when IDENTITY_INSERT is set to OFF.

I used the source code and still got the same error.
Please help!
Thank you,
Hoa
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old July 6th, 2009, 11:30 AM
Imar's Avatar
Wrox Author
Points: 33,554, Level: 80
Points: 33,554, Level: 80 Points: 33,554, Level: 80 Points: 33,554, Level: 80
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 10,228
Thanks: 7
Thanked 203 Times in 201 Posts
Default

Hi there,

Can you supply more information. For example, page number, Try It Out step, relevant code etc?

Also, how does your Picture table look? Is the Id column a primary key and an identity?

Finally, did you maybe make changes to the database after you created the LINQ to SQL diagram? If that's the case, you need to recreate the diagram.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004

Did this post help you? Click the button to show your appreciation!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #3 (permalink)  
Old July 7th, 2009, 11:57 AM
Registered User
Points: 12, Level: 1
Points: 12, Level: 1 Points: 12, Level: 1 Points: 12, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The issue might be because of the Database Diagrams. I couldn't get that to open. When I click on it, it genenrates this message:

"This database does not have a valid dbo user or you do not have permissions to impersonate the dbo user, so database diagramming is not available. do you want to make yourself the dbo of this database in order to use database diagramming?"

The I click onto the YES button. It then gave me this message:

"This server does not have one or more of the database objects requried to use database diagramming. Do you wish to create them"?

Then I clicked onto the YES button. Then got this message:

"Could not obtain information about Windows NT group/user: 'HGO\102225', error code 0xea"

Any help or suggestions would be appreciated.
Thank you very much!
Hoa
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #4 (permalink)  
Old July 7th, 2009, 12:48 PM
Imar's Avatar
Wrox Author
Points: 33,554, Level: 80
Points: 33,554, Level: 80 Points: 33,554, Level: 80 Points: 33,554, Level: 80
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 10,228
Thanks: 7
Thanked 203 Times in 201 Posts
Default

Not sure why you're getting that error. Google brings up a number of results, each with a different reason, so maybe you can see what's applicable in your situation:

http://www.google.com/search?hl=en&q...2&aq=f&oq=&aqi=

However, this is probably not relevant for this exercise. You need to recreate the LINQ to SQL diagram; not the database diagram.

Hope this helps,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004

Did this post help you? Click the button to show your appreciation!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #5 (permalink)  
Old July 13th, 2009, 01:42 PM
Registered User
Points: 12, Level: 1
Points: 12, Level: 1 Points: 12, Level: 1 Points: 12, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 11 - Page 377 - Try it out: Create a Relationship Between Two tables

Hello,
I went back and do all the Try It Out in chapter 11 because I had skipped it earlier which I thought might be the cause of my issue in Chapter 13.

On Page 377 - Try it Out (Create a relationship between two tables) - item #1: Right-Click the Database Diagrams element and click Add New Diagram....

I got the following:
"This database does not have a valid dbo user or you do not have permissions to impersonate the dbo user, so database diagramming is not available. do you want to make yourself the dbo of this database in order to use database diagramming?"

The I click onto the YES button. It then gave me this message:

"This server does not have one or more of the database objects requried to use database diagramming. Do you wish to create them"?

Then I clicked onto the YES button. Then got this message:

"Could not obtain information about Windows NT group/user: 'HGO\102225', error code 0xea"

I did many searches on yahoo, google but found no help in resolving this issue. I aslo double checked to make sure that my account has full access to the folder.

I am stuck on this issue and cannot move on with the rest of the book.
Any help or suggestions would be appreciated.
Thank you,
Hoa
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #6 (permalink)  
Old July 13th, 2009, 02:27 PM
Imar's Avatar
Wrox Author
Points: 33,554, Level: 80
Points: 33,554, Level: 80 Points: 33,554, Level: 80 Points: 33,554, Level: 80
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 10,228
Thanks: 7
Thanked 203 Times in 201 Posts
Default

Hi there,

The two prompts you're getting are by design and explained in the steps that guide you through creating the diagram.

The error you get seems to be related to security. It looks like your computer was connected to a domain before (group maybe) but now it can no longer find that domain?

It's a bit difficult for me to figure out remotely, so you either need to provide more information (such as security settings, the account you use to log on, whether the computer is connected to a domain, or was connected to a domain before, what the account is that SQL Services is running under, your OS and so on) or you need to contact Microsoft Support. Express is a supported product so you should be able to call them. and ask for help

Sorry if I can't help much more. It's quite impossible to do that remotely. I find many articles related to the error you're getting on Google but only you can determine if they are applicable to your situation.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004

Did this post help you? Click the button to show your appreciation!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #7 (permalink)  
Old November 6th, 2009, 09:48 AM
Registered User
Points: 9, Level: 1
Points: 9, Level: 1 Points: 9, Level: 1 Points: 9, Level: 1
Activity: 7%
Activity: 7% Activity: 7% Activity: 7%
 
Join Date: Nov 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Solution?

I think that your problem could lie in the Id fields of your Picture and PhotoAlbum tables. Did you by any chance set the Is Identity property to Yes. If so, you should set it to No.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #8 (permalink)  
Old November 6th, 2009, 09:59 AM
Imar's Avatar
Wrox Author
Points: 33,554, Level: 80
Points: 33,554, Level: 80 Points: 33,554, Level: 80 Points: 33,554, Level: 80
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 10,228
Thanks: 7
Thanked 203 Times in 201 Posts
Default

Quote:
Did you by any chance set the Is Identity property to Yes. If so, you should set it to No.
Heuh? Why would that be? Both columns (the Id column) should be an identity.

And why would this be related to the error message?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004

Did this post help you? Click the button to show your appreciation!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #9 (permalink)  
Old November 6th, 2009, 10:15 AM
Registered User
Points: 9, Level: 1
Points: 9, Level: 1 Points: 9, Level: 1 Points: 9, Level: 1
Activity: 7%
Activity: 7% Activity: 7% Activity: 7%
 
Join Date: Nov 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default No Solution :)

Ok. It works the first time you enter a record with the id not set as Is Identity once you try to enter another, if fails again because it is trying to enter a duplicate value.

Sorry for the false alarm!

The problem on my pc most definitely concerns the Id. If i force an Id number it will work. If I disable the Is Identity when entering a new photo album and give my own Id any future album additions and picture additions will work. If I leave it to SQL to add the Id the problems start. The assigned Id is not being passed to the code so I am getting a few different errors including the 'Object reference not set to an instance of an object' because of Response.Redirect(string.Format("ManagePhotoAlbum. aspx?PhotoAlbumId={0}", myPhotoAlbum.Id.ToString())); ... If i give an Id it goes through to the picture section and will only add picture data if I force an Id. Any suggestions?

Last edited by markjplatts : November 6th, 2009 at 11:07 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #10 (permalink)  
Old November 6th, 2009, 12:56 PM
Registered User
Points: 9, Level: 1
Points: 9, Level: 1 Points: 9, Level: 1 Points: 9, Level: 1
Activity: 7%
Activity: 7% Activity: 7% Activity: 7%
 
Join Date: Nov 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Maybe a fix now?

Hi again. I think I have got it now, please let me know if it makes any sense to you.

I have altered the properties for both Ids for PhotoAlbum and Pictures by setting the Auto Generated Value to True on the PlanetWrox.dbml file. Now, I can enter information as in the example.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert data in identity column Puneetjain User Groups - Other Developer User Groups 1 September 26th, 2008 03:09 AM
XML EXPLICIT with text column stevemeyns SQL Server 2005 1 February 7th, 2007 01:09 PM
RETURN IDENTITY AFTER INSERT INTO SECOND TABLE pallone SQL Language 2 August 19th, 2006 06:51 PM
getting identity column from the table g_vamsi_krish SQL Server 2000 1 March 15th, 2006 05:05 PM
Alter a column as identity for table kasanar SQL Server 2000 5 July 6th, 2005 09:44 AM



All times are GMT -4. The time now is 12:39 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc