Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3680526
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T03:35:12+00:00 2026-05-19T03:35:12+00:00

EDIT It appears the user has to enter some data for his profile, otherwise

  • 0

EDIT
It appears the user has to enter some data for his profile, otherwise I get this error below. I guess if there is no profile data, the user can not continue to enter data in other tables by default? I do not want to make entering user profile data a requirement to use the rest of the sites functionality, how can I get around this?

EDIT 2
OK I will try: To DROP a FOREIGN KEY Constraint However, my table doesn’t have a foreign key column….?

(Notes- Ref1, Ref2)

Original Question:


Currently I have been testing everything with the same user and everything has been working fine.

However, when I created a new user for the very first time and tried to enter data into my custom table, I get the following error.

The INSERT statement conflicted with
the FOREIGN KEY constraint
“FK_UserData_aspnet_Profile”. The
conflict occurred in database
“C:\ISTATE\APP_DATA\ASPNETDB.MDF”,
table “dbo.aspnet_Profile”, column
‘UserId’. The statement has been
terminated.

Not sure why I am getting this error. I have the user controls set up in ASP.NET 3.5 however all I am using is my own table or at least that I am aware of.

I have a custom UserData table that includes the columns:

id, UserProfileID, CL, LL, SL, DateTime

(id is the auto incremented int) The intent is that all users will add their data in this table and as I mentioned above it has been working fine for my original first user I created. However, when i created a new user I am getting this problem.

Here is the code that updates the database.

    protected void Button1_Click(object sender, EventArgs e)
    {

        //connect to database
        MySqlConnection database = new MySqlConnection();
        database.CreateConn(); 

        //create command object
        Command = new SqlCommand(queryString, database.Connection);

        //add parameters. used to prevent sql injection
        Command.Parameters.Add("@UID", SqlDbType.UniqueIdentifier);
        Command.Parameters["@UID"].Value = Membership.GetUser().ProviderUserKey;

        Command.Parameters.Add("@CL", SqlDbType.Int);
        Command.Parameters["@CL"].Value = InCL.Text;

        Command.Parameters.Add("@LL", SqlDbType.Int);
        Command.Parameters["@LL"].Value = InLL.Text;

        Command.Parameters.Add("@SL", SqlDbType.Int);
        Command.Parameters["@SL"].Value = InSL.Text;

        Command.ExecuteNonQuery();
     }

Source Error:

Line 84:
Command.ExecuteNonQuery();

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T03:35:13+00:00Added an answer on May 19, 2026 at 3:35 am

    Sounds like you have a foreign key constraint between the UserData and Profile tables. When there is not a record in asp_Profile that has a UserID value that equals UserProfileID in your new record in UserData table, you get this error. Not sure what your goal is, but sounds like you should just delete the FK_UserData_aspnet_Profile constraint, and then make UserData.UserProfileID nullable, since there will not always be a record in profile corresponding with your UserData table.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.