Custom membership provider problem

Discussion in 'ASP .Net' started by John, Dec 17, 2005.

  1. John

    John Guest

    Hi

    I was working fine with create user wizard and the default membership
    provider. I have now customised the membership provider as per attached
    web.config. The create user wizard picks up the custom membership provider
    fine and removes the security question/answer fields as designated in the
    custom provider.

    The problem is that when I try to create a new user in the create user
    wizard by entering the info and pressing the 'create user' button, I get the
    below error.

    What am I doing wrong and how can I fix it? I created the aspnetdb db using
    the aspnet_regsql.exe tool.

    Thanks

    Regards


    Server Error in '/Events' Application.
    --------------------------------------------------------------------------------

    An error has occurred while establishing a connection to the server. When
    connecting to SQL Server 2005, this failure may be caused by the fact that
    under the default settings SQL Server does not allow remote connections.
    (provider: SQL Network Interfaces, error: 25 - Connection string is not
    valid)
    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.Data.SqlClient.SqlException: An error has occurred
    while establishing a connection to the server. When connecting to SQL
    Server 2005, this failure may be caused by the fact that under the default
    settings SQL Server does not allow remote connections. (provider: SQL
    Network Interfaces, error: 25 - Connection string is not valid)

    Source Error:


    An unhandled exception was generated during the execution of the
    current web request. Information regarding the origin and location of the
    exception can be identified using the exception stack trace below.


    Stack Trace:


    [SqlException (0x80131904): An error has occurred while establishing a
    connection to the server. When connecting to SQL Server 2005, this failure
    may be caused by the fact that under the default settings SQL Server does
    not allow remote connections. (provider: SQL Network Interfaces, error: 25 -
    Connection string is not valid)]
    System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
    exception, Boolean breakConnection) +734979
    System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject
    stateObj) +188
    System.Data.SqlClient.TdsParser.Connect(Boolean& useFailoverPartner,
    Boolean& failoverDemandDone, String host, String failoverPartner, String
    protocol, SqlInternalConnectionTds connHandler, Int64 timerExpire, Boolean
    encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection
    owningObject, Boolean aliasLookup) +820
    System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection
    owningObject, SqlConnectionString connectionOptions, String newPassword,
    Boolean redirectedUserInstance) +628
    System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity
    identity, SqlConnectionString connectionOptions, Object providerInfo, String
    newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
    +170
    System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions
    options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection
    owningConnection) +130
    System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection
    owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28
    System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection
    owningObject) +424
    System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection
    owningObject) +66
    System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection
    owningObject) +496
    System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection
    owningConnection) +82
    System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection
    outerConnection, DbConnectionFactory connectionFactory) +105
    System.Data.SqlClient.SqlConnection.Open() +111
    System.Web.DataAccess.SqlConnectionHolder.Open(HttpContext context,
    Boolean revertImpersonate) +84
    System.Web.DataAccess.SqlConnectionHelper.GetConnection(String
    connectionString, Boolean revertImpersonation) +197
    System.Web.Security.SqlMembershipProvider.CreateUser(String username,
    String password, String email, String passwordQuestion, String
    passwordAnswer, Boolean isApproved, Object providerUserKey,
    MembershipCreateStatus& status) +3612
    System.Web.UI.WebControls.CreateUserWizard.AttemptCreateUser() +305
    System.Web.UI.WebControls.CreateUserWizard.OnNextButtonClick(WizardNavigationEventArgs
    e) +105
    System.Web.UI.WebControls.Wizard.OnBubbleEvent(Object source, EventArgs
    e) +453
    System.Web.UI.WebControls.CreateUserWizard.OnBubbleEvent(Object source,
    EventArgs e) +149
    System.Web.UI.WebControls.WizardChildTable.OnBubbleEvent(Object source,
    EventArgs args) +17
    System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35
    System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +115
    System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
    +163
    System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
    eventArgument) +7
    System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
    sourceControl, String eventArgument) +11
    System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
    System.Web.UI.Page.ProcessRequestMain(Boolean
    includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102





    --------------------------------------------------------------------------------

    Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET
    Version:2.0.50727.42
     
    John, Dec 17, 2005
    #1
    1. Advertising

  2. John

    Guest

    On Sat, 17 Dec 2005 03:04:17 -0000, "John" <>
    wrote:

    SQL server 2005 does not install with the TCP/IP protocol turned on.
    You must turn it on to cure this problem.

    >Hi
    >
    >I was working fine with create user wizard and the default membership
    >provider. I have now customised the membership provider as per attached
    >web.config. The create user wizard picks up the custom membership provider
    >fine and removes the security question/answer fields as designated in the
    >custom provider.
    >
    >The problem is that when I try to create a new user in the create user
    >wizard by entering the info and pressing the 'create user' button, I get the
    >below error.
    >
    >What am I doing wrong and how can I fix it? I created the aspnetdb db using
    >the aspnet_regsql.exe tool.
    >
    >Thanks
    >
    >Regards
    >
    >
    >Server Error in '/Events' Application.
    >--------------------------------------------------------------------------------
    >
    >An error has occurred while establishing a connection to the server. When
    >connecting to SQL Server 2005, this failure may be caused by the fact that
    >under the default settings SQL Server does not allow remote connections.
    >(provider: SQL Network Interfaces, error: 25 - Connection string is not
    >valid)
    >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.Data.SqlClient.SqlException: An error has occurred
    >while establishing a connection to the server. When connecting to SQL
    >Server 2005, this failure may be caused by the fact that under the default
    >settings SQL Server does not allow remote connections. (provider: SQL
    >Network Interfaces, error: 25 - Connection string is not valid)
    >
    >Source Error:
    >
    >
    > An unhandled exception was generated during the execution of the
    >current web request. Information regarding the origin and location of the
    >exception can be identified using the exception stack trace below.
    >
    >
    >Stack Trace:
    >
    >
    >[SqlException (0x80131904): An error has occurred while establishing a
    >connection to the server. When connecting to SQL Server 2005, this failure
    >may be caused by the fact that under the default settings SQL Server does
    >not allow remote connections. (provider: SQL Network Interfaces, error: 25 -
    >Connection string is not valid)]
    > System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
    >exception, Boolean breakConnection) +734979
    > System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject
    >stateObj) +188
    > System.Data.SqlClient.TdsParser.Connect(Boolean& useFailoverPartner,
    >Boolean& failoverDemandDone, String host, String failoverPartner, String
    >protocol, SqlInternalConnectionTds connHandler, Int64 timerExpire, Boolean
    >encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection
    >owningObject, Boolean aliasLookup) +820
    > System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection
    >owningObject, SqlConnectionString connectionOptions, String newPassword,
    >Boolean redirectedUserInstance) +628
    > System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity
    >identity, SqlConnectionString connectionOptions, Object providerInfo, String
    >newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
    >+170
    > System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions
    >options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection
    >owningConnection) +130
    > System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection
    >owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28
    > System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection
    >owningObject) +424
    > System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection
    >owningObject) +66
    > System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection
    >owningObject) +496
    > System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection
    >owningConnection) +82
    > System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection
    >outerConnection, DbConnectionFactory connectionFactory) +105
    > System.Data.SqlClient.SqlConnection.Open() +111
    > System.Web.DataAccess.SqlConnectionHolder.Open(HttpContext context,
    >Boolean revertImpersonate) +84
    > System.Web.DataAccess.SqlConnectionHelper.GetConnection(String
    >connectionString, Boolean revertImpersonation) +197
    > System.Web.Security.SqlMembershipProvider.CreateUser(String username,
    >String password, String email, String passwordQuestion, String
    >passwordAnswer, Boolean isApproved, Object providerUserKey,
    >MembershipCreateStatus& status) +3612
    > System.Web.UI.WebControls.CreateUserWizard.AttemptCreateUser() +305
    > System.Web.UI.WebControls.CreateUserWizard.OnNextButtonClick(WizardNavigationEventArgs
    >e) +105
    > System.Web.UI.WebControls.Wizard.OnBubbleEvent(Object source, EventArgs
    >e) +453
    > System.Web.UI.WebControls.CreateUserWizard.OnBubbleEvent(Object source,
    >EventArgs e) +149
    > System.Web.UI.WebControls.WizardChildTable.OnBubbleEvent(Object source,
    >EventArgs args) +17
    > System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35
    > System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +115
    > System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
    >+163
    > System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
    >eventArgument) +7
    > System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
    >sourceControl, String eventArgument) +11
    > System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
    > System.Web.UI.Page.ProcessRequestMain(Boolean
    >includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102
    >
    >
    >
    >
    >
    >--------------------------------------------------------------------------------
    >
    >Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET
    >Version:2.0.50727.42
    >
     
    , Dec 17, 2005
    #2
    1. Advertising

  3. John

    John Guest

    Sorry forgot to mention, did that already using the surface configuration
    tool. Everything was working fine until I switched to the custom membership
    provider as I did not need the security question/answer fields in the create
    user wizard and someone said I should switch to custom membership provider.

    Thanks

    Regards


    <> wrote in message
    news:...
    > On Sat, 17 Dec 2005 03:04:17 -0000, "John" <>
    > wrote:
    >
    > SQL server 2005 does not install with the TCP/IP protocol turned on.
    > You must turn it on to cure this problem.
    >
    >>Hi
    >>
    >>I was working fine with create user wizard and the default membership
    >>provider. I have now customised the membership provider as per attached
    >>web.config. The create user wizard picks up the custom membership provider
    >>fine and removes the security question/answer fields as designated in the
    >>custom provider.
    >>
    >>The problem is that when I try to create a new user in the create user
    >>wizard by entering the info and pressing the 'create user' button, I get
    >>the
    >>below error.
    >>
    >>What am I doing wrong and how can I fix it? I created the aspnetdb db
    >>using
    >>the aspnet_regsql.exe tool.
    >>
    >>Thanks
    >>
    >>Regards
    >>
    >>
    >>Server Error in '/Events' Application.
    >>--------------------------------------------------------------------------------
    >>
    >>An error has occurred while establishing a connection to the server. When
    >>connecting to SQL Server 2005, this failure may be caused by the fact that
    >>under the default settings SQL Server does not allow remote connections.
    >>(provider: SQL Network Interfaces, error: 25 - Connection string is not
    >>valid)
    >>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.Data.SqlClient.SqlException: An error has
    >>occurred
    >>while establishing a connection to the server. When connecting to SQL
    >>Server 2005, this failure may be caused by the fact that under the default
    >>settings SQL Server does not allow remote connections. (provider: SQL
    >>Network Interfaces, error: 25 - Connection string is not valid)
    >>
    >>Source Error:
    >>
    >>
    >> An unhandled exception was generated during the execution of the
    >>current web request. Information regarding the origin and location of the
    >>exception can be identified using the exception stack trace below.
    >>
    >>
    >>Stack Trace:
    >>
    >>
    >>[SqlException (0x80131904): An error has occurred while establishing a
    >>connection to the server. When connecting to SQL Server 2005, this
    >>failure
    >>may be caused by the fact that under the default settings SQL Server does
    >>not allow remote connections. (provider: SQL Network Interfaces, error:
    >>25 -
    >>Connection string is not valid)]
    >> System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
    >>exception, Boolean breakConnection) +734979
    >>
    >> System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject
    >>stateObj) +188
    >> System.Data.SqlClient.TdsParser.Connect(Boolean& useFailoverPartner,
    >>Boolean& failoverDemandDone, String host, String failoverPartner, String
    >>protocol, SqlInternalConnectionTds connHandler, Int64 timerExpire, Boolean
    >>encrypt, Boolean trustServerCert, Boolean integratedSecurity,
    >>SqlConnection
    >>owningObject, Boolean aliasLookup) +820
    >>
    >> System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection
    >>owningObject, SqlConnectionString connectionOptions, String newPassword,
    >>Boolean redirectedUserInstance) +628
    >>
    >> System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity
    >>identity, SqlConnectionString connectionOptions, Object providerInfo,
    >>String
    >>newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
    >>+170
    >>
    >> System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions
    >>options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection
    >>owningConnection) +130
    >>
    >> System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection
    >>owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28
    >> System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection
    >>owningObject) +424
    >>
    >> System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection
    >>owningObject) +66
    >> System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection
    >>owningObject) +496
    >> System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection
    >>owningConnection) +82
    >> System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection
    >>outerConnection, DbConnectionFactory connectionFactory) +105
    >> System.Data.SqlClient.SqlConnection.Open() +111
    >> System.Web.DataAccess.SqlConnectionHolder.Open(HttpContext context,
    >>Boolean revertImpersonate) +84
    >> System.Web.DataAccess.SqlConnectionHelper.GetConnection(String
    >>connectionString, Boolean revertImpersonation) +197
    >> System.Web.Security.SqlMembershipProvider.CreateUser(String username,
    >>String password, String email, String passwordQuestion, String
    >>passwordAnswer, Boolean isApproved, Object providerUserKey,
    >>MembershipCreateStatus& status) +3612
    >> System.Web.UI.WebControls.CreateUserWizard.AttemptCreateUser() +305
    >>
    >> System.Web.UI.WebControls.CreateUserWizard.OnNextButtonClick(WizardNavigationEventArgs
    >>e) +105
    >> System.Web.UI.WebControls.Wizard.OnBubbleEvent(Object source, EventArgs
    >>e) +453
    >> System.Web.UI.WebControls.CreateUserWizard.OnBubbleEvent(Object source,
    >>EventArgs e) +149
    >> System.Web.UI.WebControls.WizardChildTable.OnBubbleEvent(Object source,
    >>EventArgs args) +17
    >> System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
    >> +35
    >> System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +115
    >> System.Web.UI.WebControls.Button.RaisePostBackEvent(String
    >> eventArgument)
    >>+163
    >>
    >> System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
    >>eventArgument) +7
    >> System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
    >>sourceControl, String eventArgument) +11
    >> System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
    >> System.Web.UI.Page.ProcessRequestMain(Boolean
    >>includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102
    >>
    >>
    >>
    >>
    >>
    >>--------------------------------------------------------------------------------
    >>
    >>Version Information: Microsoft .NET Framework Version:2.0.50727.42;
    >>ASP.NET
    >>Version:2.0.50727.42
    >>
     
    John, Dec 17, 2005
    #3
  4. John

    stribbed

    Joined:
    Jun 21, 2007
    Messages:
    1
    Did anyone find a solution

    Hi,

    I have a similar issue to the above. However I am using SQL Server 2000. I ahve recently customised my membership provider to allow one profile field and to add user roles.

    Now I receive the error:
    "An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections"
     
    stribbed, Jun 21, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. sloan
    Replies:
    5
    Views:
    1,519
    sloan
    Jun 4, 2006
  2. =?ISO-8859-1?Q?Carlos_Guzm=E1n_=C1lvarez?=

    Problem with Login Control and Custom Membership provider

    =?ISO-8859-1?Q?Carlos_Guzm=E1n_=C1lvarez?=, Jan 22, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    533
    =?ISO-8859-1?Q?Carlos_Guzm=E1n_=C1lvarez?=
    Jan 22, 2007
  3. Replies:
    0
    Views:
    762
  4. sloan
    Replies:
    1
    Views:
    521
    Chad Scharf
    Jul 3, 2007
  5. Brett Ossman

    Custom Membership Provider - Custom Error Messages

    Brett Ossman, Mar 11, 2009, in forum: ASP .Net Security
    Replies:
    0
    Views:
    797
    Brett Ossman
    Mar 11, 2009
Loading...

Share This Page