Wrox Programmer Forums
|
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 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
 
Old November 1st, 2009, 09:12 PM
Registered User
 
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
 
Old November 3rd, 2009, 04:31 PM
Lee Dumond's Avatar
Wrox Author
 
Join Date: Jan 2008
Posts: 923
Thanks: 12
Thanked 166 Times in 162 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(); 
}
 
Old November 4th, 2009, 07:20 AM
Registered User
 
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.
 
Old November 4th, 2009, 09:20 AM
Lee Dumond's Avatar
Wrox Author
 
Join Date: Jan 2008
Posts: 923
Thanks: 12
Thanked 166 Times in 162 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(); 
}





Similar Threads
Thread Thread Starter Forum Replies Last Post
INSERT Fails teddyk ASP.NET 2.0 Basics 3 July 23rd, 2008 08: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 11:48 AM
BULK INSERT FAILS everest SQL Server 2000 0 February 23rd, 2006 12:55 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.