View Single Post
  #4 (permalink)  
Old July 5th, 2009, 05:41 AM
Imar's Avatar
Imar Imar is offline
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,

A couple of things:

1. Please use the "Remove Text Formatting" button on the toolbar of the editor when posting here. Then wrap the text in code tags by using the code button. Otherwise, the code gets impossible to read.

2. Please provide more information. Like I said in my previous message, I need to know things like whether or not the items shows up in the database or not. Because of a bug in this forum I cannot use your code as-is (or at all, in fact), so it's difficult for me to reproduce the problem without more background information.

Then make sure you did the following:

1. Make Id a primary key in step 1
2. Enable inserting on the data source in step 6
3. Enable inserting on the FormView in step 7
4. Set the default mode to Insert.

If you confirmed all this and it still doesn't work, take a copy of this page from the download that comes with this book. Does it work then?

I also notice you have a proeprty called id. Is that correct? The table column was initially called Id with a capital I.

Finally, you seem to be missing an InsertVisible="False" on the Id column in the FormView. You should hide that control as it's auto generated by the database (maybe you did make it a primary but not an identity?)

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