 |
Yet Another Forum.NET
»
YAF Forum Discussions
»
Bugs & Problems
»
v1.9.3 Issues
»
Cannot insert the value NULL into column 'UserID' - yaf 193
|
|
 Rank: YAF Forumling
Joined: 9/17/2008 Posts: 7 Location: NY
|
Hello everybody, I'm trying to run a fresh install of 193 i got from https://yafdotnet.svn.so.../yafdotnet/trunk/yafsrc
I searched the forum and found people who have had the same problem but nobody mentioned a solution. It seems like i'm missing something simple. Thanks This is the error Cannot insert the value NULL into column 'UserID', table 'yafnet193.dbo.yaf_UserGroup'; column does not allow nulls. INSERT fails. The statement has been terminated. Source Error: Line 387: { Line 388: cmd.Transaction = trans; Line 389: cmd.ExecuteNonQuery(); Line 390: trans.Commit(); Line 391: } Source File: D:\SITES\yaf1933_beta\YAF.Classes\YAF.Classes.Data\DBAccess.cs Line: 389
|
|
|
 Rank: YAF Forumling
Joined: 9/17/2008 Posts: 7 Location: NY
|
|
|
|
 Rank: YAF MVP

Joined: 2/12/2005 Posts: 927 Location: Italy
|
what are you tryingto do when you get this error? .....the man in black fled across the desert..........and the gunslinger followed.....
|
|
|
 Rank: YAF Forumling
Joined: 9/17/2008 Posts: 7 Location: NY
|
sorry.
i'm trying to create a new user.
|
|
|
 Rank: YAF MVP

Joined: 2/12/2005 Posts: 927 Location: Italy
|
If your doing a site integration, make sure all of your old groups got imported into YAF. If your doing a fresh install, try re-creating the DB again. .....the man in black fled across the desert..........and the gunslinger followed.....
|
|
|
 Rank: YAF Forumling
Joined: 9/17/2008 Posts: 7 Location: NY
|
OK after re-installing a new db i still get the same problem
Cannot insert the value NULL into column 'UserID', table 'yaf193b.dbo.yaf_UserGroup'; column does not allow nulls. INSERT fails. The statement has been terminated.
I get this error whenever I click on any link - search, active topics, log in, register, forum link, rss feed, anything.
|
|
|
 Rank: YAF Head Dude

Joined: 10/10/2004 Posts: 3,045 Location: Honolulu, HI
|
Known issue. Fix is in RC1 which is not released yet. Changes are to one of the stored procedures. Run this SQL to fix: Code:
ALTER PROCEDURE [dbo].[yaf_user_aspnet](@BoardID int,@UserName nvarchar(50),@Email nvarchar(50),@ProviderUserKey nvarchar(64),@IsApproved bit) as
BEGIN
SET NOCOUNT ON
DECLARE @UserID int, @RankID int, @approvedFlag int
SET @approvedFlag = 0;
IF (@IsApproved = 1) SET @approvedFlag = 2;
IF EXISTS(SELECT 1 FROM [dbo].[yaf_User] where BoardID=@BoardID and ([ProviderUserKey]=@ProviderUserKey OR [Name] = @UserName))
BEGIN
SELECT TOP 1 @UserID = UserID FROM [dbo].[yaf_User] WHERE [BoardID]=@BoardID and ([ProviderUserKey]=@ProviderUserKey OR [Name] = @UserName)
UPDATE [dbo].[yaf_User] SET
[Name] = @UserName,
Email = @Email,
[ProviderUserKey] = @ProviderUserKey,
Flags = Flags | @approvedFlag
WHERE
UserID = @UserID
END ELSE
BEGIN
SELECT @RankID = RankID from [dbo].[dbo].[yaf_Rank] where (Flags & 1)<>0 and BoardID=@BoardID
INSERT INTO [dbo].[yaf_User](BoardID,RankID,[Name],Password,Email,Joined,LastVisit,NumPosts,TimeZone,Flags,ProviderUserKey)
VALUES(@BoardID,@RankID,@UserName,'-',@Email,getdate(),getdate(),0,0,@approvedFlag,@ProviderUserKey)
set @UserID = SCOPE_IDENTITY()
END
SELECT UserID=@UserID
END
GO
"When you are grateful, fear disappears and abundance appears”." 
|
|
|
 Rank: YAF Forumling
Joined: 12/13/2005 Posts: 1 Location: Australia
|
Just check, there are 2 [dbo].[dbo] on one line. Quote:SELECT @RankID = RankID from [dbo].[dbo].[yaf_Rank] where (Flags & 1)<>0 and BoardID=@BoardID If you are using the svn code try this patch: Quote:Index: procedures.sql =================================================================== --- procedures.sql (revision 2167) +++ procedures.sql (working copy) @@ -4309,7 +4309,7 @@ UserID = @UserID END ELSE BEGIN - SELECT @RankID = RankID from [dbo].[{databaseOwner}].[{objectQualifier}Rank] where (Flags & 1)<>0 and BoardID=@BoardID + SELECT @RankID = RankID from [{databaseOwner}].[{objectQualifier}Rank] where (Flags & 1)<>0 and BoardID=@BoardID INSERT INTO [{databaseOwner}].[{objectQualifier}User](BoardID,RankID,[Name],Password,Email,Joined,LastVisit,NumPosts,TimeZone,Flags,ProviderUserKey) VALUES(@BoardID,@RankID,@UserName,'-',@Email,getdate(),getdate(),0,0,@approvedFlag,@ProviderUserKey)
Code:ALTER PROCEDURE [dbo].[yaf_user_aspnet](@BoardID int,@UserName nvarchar(50),@Email nvarchar(50),@ProviderUserKey nvarchar(64),@IsApproved bit) as BEGIN SET NOCOUNT ON
DECLARE @UserID int, @RankID int, @approvedFlag int
SET @approvedFlag = 0; IF (@IsApproved = 1) SET @approvedFlag = 2; IF EXISTS(SELECT 1 FROM [dbo].[yaf_User] where BoardID=@BoardID and ([ProviderUserKey]=@ProviderUserKey OR [Name] = @UserName)) BEGIN SELECT TOP 1 @UserID = UserID FROM [dbo].[yaf_User] WHERE [BoardID]=@BoardID and ([ProviderUserKey]=@ProviderUserKey OR [Name] = @UserName)
UPDATE [dbo].[yaf_User] SET [Name] = @UserName, Email = @Email, [ProviderUserKey] = @ProviderUserKey, Flags = Flags | @approvedFlag WHERE UserID = @UserID END ELSE BEGIN SELECT @RankID = RankID from [dbo].[yaf_Rank] where (Flags & 1)<>0 and BoardID=@BoardID
INSERT INTO [dbo].[yaf_User](BoardID,RankID,[Name],Password,Email,Joined,LastVisit,NumPosts,TimeZone,Flags,ProviderUserKey) VALUES(@BoardID,@RankID,@UserName,'-',@Email,getdate(),getdate(),0,0,@approvedFlag,@ProviderUserKey) set @UserID = SCOPE_IDENTITY() END SELECT UserID=@UserID END GO
|
|
|
| Users browsing this topic |
|
Guest
|
Yet Another Forum.NET
»
YAF Forum Discussions
»
Bugs & Problems
»
v1.9.3 Issues
»
Cannot insert the value NULL into column 'UserID' - yaf 193
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
YAFPro Theme Created by Jaben Cargman (Tiny Gecko)Powered by YAF 1.9.3 RC2 | YAF © 2003-2008, Yet Another Forum.NETThis page was generated in 0.110 seconds.
|
 |