connectionString parameters

Discussion in 'Databases' started by pickle, Aug 6, 2008.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. I have just uploaded my first web-site to discountasp.net. My files contain App_Data folder with ASPNETDB data file for membership administration. I have uploaded it successfully to the remote host into _database root folder.

    I guess I need to configure my connectionString accordingly to get DB up and running. Where do I get the input parameters for connectionString? Do I need to add MS SQL Server 2005 to my accout first?

    Thanks
    pickle
     
  2. Hi,
    I've created a video (#3) for the Membership roles.
    http://iis7test.com/webcasts/

    Yes...Once you have added SQL Server 2005 to your account the connection string needed will be listed for you.
    Salute,
    Mark
     
  3. Thanks Mark,

    Great video. I am still wondering. I have already created my ASPNETDB membership file in my local Express version and have already uploaded it to the remote db file.
    If I change the connectionString settings to point to my remote SQL Server 2005 sourse, will this not override at the compile time all my original setting from Express and get it working that way?
    Or do I need to create a new Membership provider according to steps in your video on Membership?

    Thanks,
    pickle
     
  4. Hi,
    If you have the SQL Server 2005 addon you can use the Attach feature.
    Otherwise I'd suggest running the method in the video for the remote SQL Server.


    I've tested both methods for customers here and each went very well.
    Salute,
    Mark
     
  5. Like Pickle, I have just uploaded my first web-site to discountasp.net. My files contain App_Data folder with ASPNETDB data file for membership administration. I have uploaded it successfully to the remote host.

    I had already configured my connectionString according to the information sent to me.

    I then watched Mark's video and got SQL to point to my database.

    However, when I try to access my test web site via Internet Explorer, I get an error on line 160 of my machine.config file. This line says:

    Line 159: <providers>
    Line 160: <add name="AspNetSqlRoleProvider" connectionStringName="LocalSqlServer" applicationName="/" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

    Not sure what to do aboutthis. I had closed my SQL connection before transferring to your server and I'm notsure how toopenit again. Perhaps thats the problem?

    Before all this,I had beenable to access my test database successfully.

    Thanks for any help.
     
  6. Hi,
    machine.config?

    Post the connections area of your root web.config, comment out the passwords.
    You can also search for the recommended connections I've posted here in the past.

    If you get stuck let me know.
    Salute,
    Mark
     
  7. Thanks for your speedy reply. Connection string is:
    <connectionStrings>



    <add name="ConnectionString"


    connectionString="Data Source=tcp:esql2k501.discountasp.net;Initial Catalog=SQL2005_532129_aspnetdb;User ID=SQL2005_532129_aspnetdb_user;Password=xxxxx;"


    providerName="System.Data.SqlClient" />


    </connectionStrings>


    Actually, when I tried to upload the new config sys file withthe above connection string, I got an error message but it appeared to upload all thesame. I verified this on the second attempt by deleting the host copy before I made the transfer.


    The error message said "Could not find a Web server at 'appealswwco.eweb701.discountasp.net' on port 21" but, before the database saga, I had been accessing my test web site (non-data-related pages) with no problems.


    JHTotnes
     
  8. Try it like this:

     
  9. Great - I can now access my web site again.[​IMG]


    However - I hate to say this - I get an error when I try and create a new user for testingpurposes. For what it's worth,here it is in all its glory..


    [SqlException (0x80131904): Login failed for user 'SQL2005_532129_aspnetdb_user'.]
    System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +800131
    System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +186
    System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1932
    System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +33
    System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +172
    System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +381
    System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +181
    System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +173
    System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +357
    System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +30
    System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +424
    System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66
    System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +494
    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&amp; status) +3629
    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) +1746
     
  10. Bruce

    Bruce DiscountASP.NET Staff

    check your connection string's SQL password. This error means that you are either using the wrong username OR password.


    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  11. Thanks, Bruce. You're right - I had made a typo. error in the password and can only plead tiredness after a late-night session. However, I now get a slightly different error message when I try to create a new user:


    [SqlException (0x80131904): Could not find stored procedure


    'dbo.aspnet_CheckSchemaVersion'.]
    System.Data.SqlClient.SqlConnection.OnError(SqlException exception,


    Boolean breakConnection) +925466
    System.Data.SqlClient.SqlInternalConnection.OnError(SqlException


    exception, Boolean breakConnection) +800118



    System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserState


    Object stateObj) +186
    System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior,


    SqlCommand cmdHandler, SqlDataReader dataStream,


    BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)


    +1932
    System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader


    ds, RunBehavior runBehavior, String resetOptionsString) +149
    System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior


    cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean


    async) +1005
    System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior


    cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String


    method, DbAsyncResult result) +132



    System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult


    result, String methodName, Boolean sendToPipe) +149
    System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +135
    System.Web.Util.SecUtility.CheckSchemaVersion(ProviderBase provider,


    SqlConnection connection, String[] features, String version, Int32&amp;


    schemaVersionCheck) +367



    System.Web.Security.SqlMembershipProvider.CheckSchemaVersion(SqlConnect


    ion connection) +85
    System.Web.Security.SqlMembershipProvider.CreateUser(String


    username, String password, String email, String passwordQuestion,


    String passwordAnswer, Boolean isApproved, Object providerUserKey,


    MembershipCreateStatus&amp; status) +3629
    System.Web.UI.WebControls.CreateUserWizard.AttemptCreateUser() +305



    System.Web.UI.WebControls.CreateUserWizard.OnNextButtonClick(WizardNavi


    gationEventArgs 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.Ra


    isePostBackEvent(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)


    +1746


    Can you manage to unravel that one??


    Many thanks,


    Julian
     
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