[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

11/04/2009 at 07:53AM PST, ID: 24871250
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.2

Extending Membership Wizard - Insert command fails

Asked by JesGoth in .NET Framework 2.x, .NET

Tags: asp.net vs2005 CreateUserWizard

Hi Folks,

I'm trying to implement a modified membership wizard using asp.net.  The application works without the extended membership control and it appears that everything is present and correct when debugging but when I uncomment the ThisDataSource.Insert() command it throws an error saying the provider isn't present!

Any thoughts?

Here is the code that is failing:
[code]
    Protected Sub CreateUserWizard1_CreatedUser(ByVal sender As Object, ByVal e As System.EventArgs) Handles CreateUserWizard1.CreatedUser
        Dim UserNameTextBox As New TextBox
        Dim ThisDataSource As SqlDataSource
        Dim user As MembershipUser
        Dim UserGuid As New Object

        UserNameTextBox = CreateUserWizardStep1.ContentTemplateContainer.FindControl("Username")
        ThisDataSource = DirectCast(CreateUserWizardStep1.ContentTemplateContainer.FindControl("InsertExtraInfo"), SqlDataSource)

        user = Membership.GetUser(UserNameTextBox.Text)
        UserGuid = user.ProviderUserKey

        Response.Write("User = " & user.ToString() & "<BR>")
        Response.Write("User Guid = " & UserGuid.ToString() & "<BR>")
        Response.Write("This Data Source = " & ThisDataSource.ProviderName.ToString() & "<BR>")

        ThisDataSource.InsertParameters.Add("User_Id", UserGuid.ToString())
        Response.Write(ThisDataSource.InsertCommand & "<BR>")
        '        Response.Write(ThisDataSource..ToString() & "<BR>")

        Dim aParameter As Parameter
        For Each aParameter In ThisDataSource.InsertParameters
            Response.Write(aParameter.Name & "<BR>")
        Next

        ThisDataSource.Insert()

    End Sub
[/code]

Here is the datasource within the page
[code]
                    <asp:sqlDataSource ID="InsertExtraInfo" runat="server" ConnectionString="<%$ConnectionStrings:Test_Authorisation_DB %>"
                    InsertCommand="INSERT INTO [T_UserAgencies] (ua_UserId, ua_AgencyId, ua_StartDate) Values (@User_Id, @Agency_Id, @StartDate)"
                    ProviderName = "<%$ ConnectionStrings:Test_Authorisation_DB %>">
                    <InsertParameters>
                    <asp:ControlParameter Name="Agency_Id" Type="String" ControlId="Agency" PropertyName="Text" />
                    <asp:ControlParameter Name="StartDate" Type = "DateTime" ControlId="StartDate_TextBox" PropertyName="Text" />
                 
                    </InsertParameters>
                </asp:sqlDataSource>
[/code]

and here is the output (where the insert is commented out)
[code]
User = dfgdg
User Guid = ba3b032d-0c2a-4cc5-8828-a27e443d5418
This Data Source = Data Source=TCBC17985;Initial Catalog=Test_Authentication_DB;Integrated Security=True
INSERT INTO [T_UserAgencies] (ua_UserId, ua_AgencyId, ua_StartDate) Values (@User_Id, @Agency_Id, @StartDate)
Agency_Id
StartDate
User_Id
[/code]

So everything appears to be present, it just falls on its backside.  

Any help gratefully received.

Thanks
[+][-]11/04/09 08:34 AM, ID: 25741049

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/04/09 08:59 AM, ID: 25741369

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/04/09 09:50 AM, ID: 25741905

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: .NET Framework 2.x, .NET
Tags: asp.net vs2005 CreateUserWizard
Sign Up Now!
Solution Provided By: guru_sami
Participating Experts: 1
Solution Grade: C
 
 
 
Loading Advertisement...
20090824-EE-VQP-74 - Hierarchy / EE_QW_3_20080625