|
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 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
|
|
|
|
July 5th, 2009, 06:30 AM
|
|
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
It would be a lot easier if you answered some of the questions I am asking. Clearly, something is wrong and only if you help me helping you can we figure this out.
==> Did you regenerate the entire Linq to SQL diagram after you changed the database?
==> Does the record get inserted?
==> Is the Id column the primary key?
Imar
|
July 5th, 2009, 06:34 AM
|
|
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
>>running it without copying and pasting seems to work.
That seems to suggest a problem with the database or with the LINQ to SQL diagram. So, verify your database is OK and has the right keys and identities. Then regenerate the Linq diagram and try again.
Cheers,
Imar
|
July 5th, 2009, 06:41 AM
|
Authorized User
|
|
Join Date: Apr 2009
Posts: 54
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Imar,
I went back into the database disgrams and they are still there. I looked around for something that says regenerate or something to that affect and couldn't find anything.
In answer to your second question I cannot insert any records through the website as you know because it simply generates the error in question. How else are we to test whether a record gets inserted?
In answer to your last question, yes the Id column is the primary key.
Thanks
Thomas
|
July 5th, 2009, 06:58 AM
|
|
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
I meant to regenerate (recreate) the Linq to SQL diagram.
Delete it, add a new one and drag your tables on the design surface. I think you made changes to the database that the LINQ to SQL diagram is unaware off.
And with checking the records I was trying to find out if the insert succeeded but that afterwards something goes wrong.
Imar
|
July 5th, 2009, 07:37 AM
|
|
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Quote:
I went back into the database disgrams and they are still there. I looked around for something that says regenerate or something to that affect and couldn't find anything.
|
This isn't about the Database Diagrams you create in SQL Server, but about the LINQ to SQL diagrams in VWD you created on page 428 and that you update on page 445. You can delete the entire diagram and recreate it with the instructions on these two pages.
If all else fails, send me a message through the Contact page of my personal web site. I'll reply so you know my e-mail address and then send me a zipped version of the project so I can take a look.
Cheers,
Imar
|
August 8th, 2009, 06:14 AM
|
Authorized User
|
|
Join Date: Apr 2009
Posts: 19
Thanks: 3
Thanked 0 Times in 0 Posts
|
|
Hi there
Just to add info as this might help, I got the same problem, mainly because I changed the ID columns to 'identity' type, and DID NOT recreate the LINQ to SQL diagram. When I did, everything went well. Just double click the .dbml file and remove the diagrams, then drag again and link them. This will definitely work. cheers
|
|
|