[2.0] Cannot create membership database on webhost provider

Discussion in 'ASP .Net Security' started by ~~~ .NET Ed ~~~, Feb 27, 2007.

  1. Hi,
    I am having problems creating the necessary membership stuff on my
    webhost. Here is the information.

    My webhost provider (shared hosting) has Microsoft .NET v2.0 and both MSSQL
    databases. Obviously one as customer has no access to the master tables
    where the membership scripts deploy themselves.

    On my shared hosting I created a SQL Server 2005 database, say I called it
    MyMembers to which I had to assign a user and password credentials at the
    time of creation. Unfortunately I have gotten stuck there.

    Approach #1: ASPNET_REGSQL
    --------------
    I used aspnet_regsql .exe, entered the Server name (the SQL server address
    of my webhost provider), selected SQL Server Authentication and entered the
    user/password assigned when I created the database. Also entered the name of
    the database exactly as I created it (i.e. MyMembers) because it can't do
    the browsing.

    I then clicked Next and was presented with the server name and DB name.
    Clicked Next again and after a few moments I got the following error:

    Setup failed.

    Exception:
    Unable to connect to SQL Server database.

    ----------------------------------------
    Details of failure
    ----------------------------------------

    System.Web.HttpException: Unable to connect to SQL Server database. --->
    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: Named Pipes Provider, error:
    40 - Could not open a connection to SQL Server)
    at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
    exception, Boolean breakConnection)
    at
    System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject
    stateObj)
    at 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)
    at
    System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection
    owningObject, SqlConnectionString connectionOptions, String newPassword,
    Boolean redirectedUserInstance)
    at
    System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity
    identity, SqlConnectionString connectionOptions, Object providerInfo, String
    newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
    at
    System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions
    options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection
    owningConnection)
    at
    System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection
    owningConnection, DbConnectionPool pool, DbConnectionOptions options)
    at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection
    owningObject)
    at
    System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection
    owningObject)
    at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection
    owningObject)
    at
    System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection
    owningConnection)
    at
    System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection
    outerConnection, DbConnectionFactory connectionFactory)
    at System.Data.SqlClient.SqlConnection.Open()
    at System.Web.Management.SqlServices.GetSqlConnection(String server,
    String user, String password, Boolean trusted, String connectionString)
    --- End of inner exception stack trace ---
    at System.Web.Management.SqlServices.GetSqlConnection(String server,
    String user, String password, Boolean trusted, String connectionString)
    at System.Web.Management.SqlServices.SetupApplicationServices(String
    server, String user, String password, Boolean trusted, String
    connectionString, String database, String dbFileName, SqlFeatures features,
    Boolean install)
    at System.Web.Management.SqlServices.Install(String database, SqlFeatures
    features, String connectionString)
    at System.Web.Management.ConfirmPanel.Execute()

    Approach #2: MANAGEMENT STUDIO EXPRESS
    -------------------------------------------------------
    Given that option #1 did not work I used the Microsoft SQL Server Management
    Studio Express to setup a connection to the DB server on the webhost
    provider. The connection succeeded and I was presented with a tree
    containing the server name and the databases.

    I can see there the database I created on the webhost (MyMembers). Obviously
    given that it is shared hosting I only have rights to that database and not
    any other.

    I read somewhere that if ASPNET_REGSQL did not work one could run
    InstallCommon.sql and then InstallMembership.sql so I tried to do that using
    the Management studio but got stomped with:

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

    Starting execution of InstallCommon.SQL

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

    Creating the aspnetdb database...

    Msg 262, Level 14, State 1, Line 1

    CREATE DATABASE permission denied in database 'master'.

    Msg 916, Level 14, State 1, Line 2

    The server principal "cptyuser" is not able to access the database
    "ASPNETDB" under the current security context.

    (120 row(s) affected)

    Creating the aspnet_Applications table...

    Creating the aspnet_Users table...

    Creating the aspnet_SchemaVersions table...

    Cannot grant, deny, or revoke permissions to sa, dbo, information_schema,
    sys, or yourself.

    Cannot grant, deny, or revoke permissions to sa, dbo, information_schema,
    sys, or yourself.

    (0 row(s) affected)

    (1 row(s) affected)

    Cannot grant, deny, or revoke permissions to sa, dbo, information_schema,
    sys, or yourself.

    Creating the vw_aspnet_Applications view...

    Creating the vw_aspnet_Users view...

    Cannot grant, deny, or revoke permissions to sa, dbo, information_schema,
    sys, or yourself.

    Cannot grant, deny, or revoke permissions to sa, dbo, information_schema,
    sys, or yourself.

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

    Completed execution of InstallCommon.SQL

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



    So, what can I do? can somebody tell me how I can accomplish this? What I
    need to do is work on my development PC and then deploy things to the
    production site on the ISP provider.
     
    ~~~ .NET Ed ~~~, Feb 27, 2007
    #1
    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. RedHair
    Replies:
    2
    Views:
    769
    RedHair
    Feb 21, 2006
  2. sloan
    Replies:
    5
    Views:
    1,512
    sloan
    Jun 4, 2006
  3. Mwob
    Replies:
    0
    Views:
    679
  4. sloan
    Replies:
    1
    Views:
    514
    Chad Scharf
    Jul 3, 2007
  5. Jerry C

    membership provider for the sam database

    Jerry C, Jul 12, 2006, in forum: ASP .Net Security
    Replies:
    3
    Views:
    159
    Steven Cheng[MSFT]
    Jul 13, 2006
Loading...

Share This Page