modifying database

Discussion in 'Databases' started by whitebordov, May 5, 2009.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Hi,

    I have this working locally, but cannot get it to work here. I have a registration page where I want users to go through the Create User Wizard. I inserted a datasource where I want to link it to my database on here.

    In my code behind I have:

    SqlDataSource DataSource =
    (
    SqlDataSource)CreateUserWizardStep2.ContentTemplateContainer.FindControl("InsertExtraInfo");
    MembershipUser User = Membership.GetUser(UserNameTextBox.Text);
    object UserGUID = User.ProviderUserKey;
    DataSource.InsertParameters.Add(
    "UserId", UserGUID.ToString());
    DataSource.Insert();

    But when I run my page I get the error:

    Inserting is not supported by data source 'InsertExtraInfo' unless InsertCommand is specified.

    [FONT=Arial, Helvetica, Geneva, SunSans-Regular, sans-serif]Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.NotSupportedException: Inserting is not supported by data source 'InsertExtraInfo' unless InsertCommand is specified.

    Source Error:

    Line 34: DataSource.InsertParameters.Add("UserId", UserGUID.ToString());Line 35: Line 36: DataSource.Insert();Line 37: Line 38: }[/FONT]


    How do I fix this?? Thanks.
     
  2. Bruce

    Bruce DiscountASP.NET Staff

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page