locked
Publishing my project RRS feed

  • Question

  • User-300552668 posted

    Hi,

    I'm looking for a way to publish my Web Application with database on the internet.

    I got to publish a project without database. It work. But I can't get it work with a SQL Database.

    I found the following tutorial: http://www.youtube.com/watch?v=K3QRfTXwIW8

    The problem is that I get the message: Login failed for user 'sa'.

    I've already enabled 'sa's logon and set "SQL and Windows authentication" with SQL Server Management Studio.

    What do I do?

    Thanks.


    Tuesday, March 2, 2010 2:33 PM

Answers

  • User-300552668 posted

    I got it...

    I tried to create de database from the SQL Server 2008 instead of creating it from Visual Studio. Then I got the tables with ADO.NET Entity Data Model.

    Then it worked perfectly.

    Thanks for the help.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, March 7, 2010 8:51 PM

All replies

  • User-1853252149 posted

    Always post full errors and make sure that your connection string is appropriate for your server configuration.

    Jeff

    Tuesday, March 2, 2010 2:42 PM
  • User-300552668 posted

    Ok...

    First of all I created a testing Web Application that you can download here: http://www.megaupload.com/?d=MWM1FH2I

    The variables names are in portuguese because I'm from Brazil, hehe.

    The problem is that I follow the tutorial I found (http://www.youtube.com/watch?v=K3QRfTXwIW8) and I can't get my Application run with Database.


    My web.config's connection string is like that:


    <connectionStrings>
            <add name="NovoTesteDataConnectionString" connectionString="Data Source=Guto-PC\SQLEXPRESS;Initial Catalog=TesteData;Persist Security Info=True;User 
    ID=sa;Password=123"
                providerName="System.Data.SqlClient" />
        </connectionStrings>


    <connectionStrings>

            <add name="NovoTesteDataConnectionString" connectionString="Data Source=Guto-PC\SQLEXPRESS;Initial Catalog=TesteData;Persist Security Info=True;User ID=sa;Password=123" providerName="System.Data.SqlClient" />

        </connectionStrings>


    Now the error I get. It's in portuguese, so I will put how it appear in portuguese and also make an approximated translation.

    Portuguese:


    Erro de Servidor no Aplicativo '/NovoTeste'.

    Login failed for user 'sa'.

    Descrição: Ocorreu uma exceção não tratada durante a execução da atual solicitação da Web. Examine o rastreamento de pilha para obter mais informações sobre o erro e onde foi originado no código. 

    Detalhes da Exceção: System.Data.SqlClient.SqlException: Login failed for user 'sa'.

    Erro de Origem: 

    Exceção não tratada foi gerada durante a execução da atual solicitação da Web. As informações relacionadas à origem e ao local da exceção podem ser identificadas usando-se o rastreamento de pilha de exceção abaixo.

    Rastreamento de Pilha: 

    [SqlException (0x80131904): Login failed for user 'sa'.]

       System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +6244425

       System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +245

       System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2811

       System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +53

       System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +248

       System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +6260362

       System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +6260328

       System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +354

       System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +703

       System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +54

       System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +6261592

       System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +81

       System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +1657

       System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +88

       System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +6265031

       System.Data.SqlClient.SqlConnection.Open() +258

       System.Data.Linq.SqlClient.SqlConnectionManager.UseConnection(IConnectionUser user) +65

       System.Data.Linq.SqlClient.SqlProvider.get_IsSqlCe() +33

       System.Data.Linq.SqlClient.SqlProvider.InitializeProviderMode() +32

       System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query) +63

       System.Data.Linq.DataQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator() +45

       NovoTeste._Default.Page_Load(Object sender, EventArgs e) in c:\users\guto\documents\visual studio 2010\Projects\NovoTeste\NovoTeste\Default.aspx.cs:21

       System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25

       System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +42

       System.Web.UI.Control.OnLoad(EventArgs e) +132

       System.Web.UI.Control.LoadRecursive() +66

       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2428



    English:

    Server Error in '/NovoTeste' Application.

    Login failed for user 'sa'.

    Description: There was an unhandled exception during execution of the current web request Examine the stack trace for more information about the error and where it originated in the code.

    Exception details: System.Data.SqlClient.SqlException: Login failed for user 'sa'.

    Source Error: 

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

    Stack trace:

    [SqlException (0x80131904): Login failed for user 'sa'.]

       System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +6244425

       System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +245

       System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2811

       System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +53

       System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +248

       System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +6260362

       System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +6260328

       System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +354

       System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +703

       System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +54

       System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +6261592

       System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +81

       System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +1657

       System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +88

       System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +6265031

       System.Data.SqlClient.SqlConnection.Open() +258

       System.Data.Linq.SqlClient.SqlConnectionManager.UseConnection(IConnectionUser user) +65

       System.Data.Linq.SqlClient.SqlProvider.get_IsSqlCe() +33

       System.Data.Linq.SqlClient.SqlProvider.InitializeProviderMode() +32

       System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query) +63

       System.Data.Linq.DataQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator() +45

       NovoTeste._Default.Page_Load(Object sender, EventArgs e) in c:\users\guto\documents\visual studio 2010\Projects\NovoTeste\NovoTeste\Default.aspx.cs:21

       System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25

       System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +42

       System.Web.UI.Control.OnLoad(EventArgs e) +132

       System.Web.UI.Control.LoadRecursive() +66

       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2428


    PS: like I've said, I've already enabled 'sa's logon and set "SQL and Windows authentication" with SQL Server Management Studio.

    Thanks for helping.

    Tuesday, March 2, 2010 7:18 PM
  • User-300552668 posted

    I got it...

    I tried to create de database from the SQL Server 2008 instead of creating it from Visual Studio. Then I got the tables with ADO.NET Entity Data Model.

    Then it worked perfectly.

    Thanks for the help.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, March 7, 2010 8:51 PM