View Single Post
  #6 (permalink)  
Old July 5th, 2009, 07:07 AM
Imar's Avatar
Imar Imar is offline
Wrox Author
Points: 33,563, Level: 80
Points: 33,563, Level: 80 Points: 33,563, Level: 80 Points: 33,563, Level: 80
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 10,231
Thanks: 7
Thanked 203 Times in 201 Posts
Default

The {0} is used in the string.Format call. Consider this:

Code:
 
string.Format("ManagePhotoAlbum.aspx?PhotoAlbumId=(0)", myPhotoAlbum.id.ToString())
This creates a string with a redirect URL based on the ID of the new photoalbum. So, if you insert a record in the database (you still haven't confirmed whether the record shows up in the database or not) its new ID is taken and appended to the redirect string. String.Format nicely puts the ID at the place of the {0} placeholder. So, when your new Album has an ID of 34, you're redirected to:

ManagePhotoAlbum.aspx?PhotoAlbumId=34

After you changed your database schema (column names etc) did you also regenerate the Linq to SQL diagram? And is your ID column a primary key AND an identity?

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!
Reply With Quote