Problem with Forum Section

Topics: Help
Jul 12, 2008 at 6:55 PM
Hello there,

I have been trying to get familiar with the Forum section of the Club Starter Kit, but I have been running into a few problems.

When I am logged into the website and I try and access a Thread to see the Messages contained within it, I get the following error message:

"The INSERT statement conflicted with the FOREIGN KEY constraint "FK_MembersThreads_MemberInfo". The conflict occurred in database "ClubSK", table "dbo.MemberInfo", column 'memberid'. The statement has been terminated."

And when I am not logged in, and I try and access the same Thread, I get the following error message:

"Object reference not set to an instance of an object." When it tries to:

Dim CurrentGUID As Guid = Membership.GetUser().ProviderUserKey()

Can anyone suggest a reason why this would be happening?

I have downloaded both the most recent source code, and version 3 Beta 1, and it seems to be happening in both. 

Am I doing something wrong?

Thanks

Gary
Jul 13, 2008 at 10:08 PM
Hi Gary,

I tried this with some older sources, when the database name was ClubDB and it went all fine.
So the database schema must have changed. Can you debug the code and try to find out which information are transmitted inside the SQL-Statement?!
Did you start autoscafold for subsonic after installing csk?

Hope that helps,
Thorsten
Jul 13, 2008 at 10:28 PM
Hello thoze,

I was able to get this to work, but I had to make a change to the code as follows:

Dim CurrentGUID As Guid = Membership.GetUser().ProviderUserKey()

to

Dim CurrentGUID As Guid
       
        Try
             CurrentGUID = Membership.GetUser().ProviderUserKey()
        Catch
            Return False
        End Try

I can understand how this would fix the second problem, but it also seems to have fixed the first one.  Very strange!!

I will continue to look into it, and will report back if I find out anything else.

Thanks

Gary