p2p.wrox.com 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 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0
This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640

Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 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 November 1st, 2009, 09:12 PM
Registered User
Points: 8, Level: 1
Points: 8, Level: 1 Points: 8, Level: 1 Points: 8, Level: 1
Activity: 5%
Activity: 5% Activity: 5% Activity: 5%
 
Join Date: Nov 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default INSERT Article fails also category fails too

Hi guys:

I open AddEditArticle.aspx for adding a new article. but when i click the insert,
the error came out. If insert category, the same problem.

Server Error in '/' Application.
Cannot insert the value NULL into column 'ArticleID', table 'aspnetdb.dbo.tbh_Articles'; column does not allow nulls. INSERT fails.
The statement has been terminated.

and SQL server profiler said that:
declare @p16 int
set @p16=NULL
exec tbh_Articles_InsertArticle @AddedDate=''2009-11-02
09:15:27:140'',@AddedBy=N'wxt',@CategoryID=1,@Titl e=N'jl;',@Abstract=N'jl;',@Body=N'<p>&nbsp;jkl;</p>',@Country=N'Albania',@State=N'jkll;',@City=N'kl jl',@ReleaseDate=''2009-11-02
09:15:27:140'',@ExpireDate=''9999-12-31 23:59:59:997'',@Approved=0,@Listed=1,@CommentsEnab led=1,@OnlyForMembers=0,@ArticleID=@p16 output
select @p16

i am confused the BLL and DAL insert function and store procedure are right, I just copy them from the code download here( insert without error). any help would be appreciate.

Last edited by f117f117f117677 : November 1st, 2009 at 09:14 PM. Reason: add some comments
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old November 3rd, 2009, 04:31 PM
Lee Dumond's Avatar
Wrox Author
Points: 4,250, Level: 27
Points: 4,250, Level: 27 Points: 4,250, Level: 27 Points: 4,250, Level: 27
Activity: 30%
Activity: 30% Activity: 30% Activity: 30%
 
Join Date: Jan 2008
Location: Decatur, IL, USA.
Posts: 807
Thanks: 12
Thanked 140 Times in 140 Posts
Default

What do you have for Insert parameters in the objCurrentArticle ObjectDataSource?

Also, are you absolutely sure you have ArticleID set up in the database as an auto-incrementing Identity field?
__________________
Visit my blog at http://leedumond.com
Follow me on Twitter: http://twitter.com/LeeDumond

Code:
if (this.PostHelpedYou)
{
   ClickThanksButton(); 
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #3 (permalink)  
Old November 4th, 2009, 07:20 AM
Registered User
Points: 8, Level: 1
Points: 8, Level: 1 Points: 8, Level: 1 Points: 8, Level: 1
Activity: 5%
Activity: 5% Activity: 5% Activity: 5%
 
Join Date: Nov 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Thumbs up Bingo

Quote:
Originally Posted by Lee Dumond View Post
What do you have for Insert parameters in the objCurrentArticle ObjectDataSource?

Also, are you absolutely sure you have ArticleID set up in the database as an auto-incrementing Identity field?

Lee Dumond
you are so brightness, my problem is i don't have ID set up as an auto-incrementing Identity field. I just correct it and running right, thanks a lot.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #4 (permalink)  
Old November 4th, 2009, 09:20 AM
Lee Dumond's Avatar
Wrox Author
Points: 4,250, Level: 27
Points: 4,250, Level: 27 Points: 4,250, Level: 27 Points: 4,250, Level: 27
Activity: 30%
Activity: 30% Activity: 30% Activity: 30%
 
Join Date: Jan 2008
Location: Decatur, IL, USA.
Posts: 807
Thanks: 12
Thanked 140 Times in 140 Posts
Default

Quote:
Originally Posted by f117f117f117677 View Post
Lee Dumond
you are so brightness,
Yes, yes I am. Thanks for noticing.
__________________
Visit my blog at http://leedumond.com
Follow me on Twitter: http://twitter.com/LeeDumond

Code:
if (this.PostHelpedYou)
{
   ClickThanksButton(); 
}
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 Fails teddyk ASP.NET 2.0 Basics 3 July 23rd, 2008 09:58 AM
Job Fails - trying to insert into remote machine happygv SQL Server 2000 0 March 8th, 2007 10:03 AM
insert fails Mitch MySQL 3 June 3rd, 2006 12:48 PM
BULK INSERT FAILS everest SQL Server 2000 0 February 23rd, 2006 12:55 PM
ASP Access Insert SQL fails ruairi ASP Pro Code Clinic 1 February 3rd, 2005 12:16 PM



All times are GMT -4. The time now is 11:22 AM.


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