I see the "Login failed for user "sa" also, but may have arrived at it in a different way.
When I first tried to access
http://localhost/thephile/ after
restoring the database ThePhile and rebuilding, I got the error
SQL Server does not exist or access denied.
Later after modifying the ConnectionString in the config files in C:\wrox\ThePhile\Config, I got the error
Login failed for user 'sa'.
1.
SQL Server does not exist or access denied.
The config files in C:\wrox\ThePhile\Config had CHARUL\NETSDK for a ConnectionString . Here is Accounts.Config as an example.
<?xml version="1.0"?>
<ModuleSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ConnectionString>server=CHARUL\NetSDK;database=Th ePhile;uid=sa;pwd=;</ConnectionString>
</ModuleSettings>
Page Error
--------------------------------------------------------------------------------
An unexpected error has occurred on this page. The system administrators have been notified.
Please feel free to contact us with the information surrounding this error.
The error occurred in:
http://localhost/thephile/Default.aspx
Error Message: SQL Server does not exist or access denied.
--------------------------------------------------------------------------------
Stack Trace:
System.Data.SqlClient.SqlException: SQL Server does not exist or access denied. at
System.Data.SqlClient.ConnectionPool.GetConnection (Boolean& isInTransaction) at
System.Data.SqlClient.SqlConnectionPoolManager.Get PooledConnection(SqlConnectionString options,
Boolean& isInTransaction) at System.Data.SqlClient.SqlConnection.Open() at
Wrox.WebModules.Data.DbObject.RunProcedure(String storedProcName, IDataParameter[] parameters,
Int32& rowsAffected) in C:\wrox\ThePhile\Modules\Core\DbObject.cs:line 104 at
Wrox.WebModules.Polls.Data.Questions.GetCurrentID( ) in
C:\wrox\ThePhile\Modules\Polls2\Polls.Data\Questio ns.cs:line 94 at
Wrox.WebModules.Polls.Business.Question.GetCurrent ID() in
C:\wrox\ThePhile\Modules\Polls2\Polls.Business\Que stion.cs:line 129 at
Wrox.WebModules.Polls.Web.Controls.User.Poll.DataB ind() in
C:\wrox\ThePhile\Modules\Polls2\Poll.ascx.cs:line 123 at
Wrox.WebModules.Polls.Web.Controls.User.Poll.Page_ Load(Object sender, EventArgs e) in
C:\wrox\ThePhile\Modules\Polls2\Poll.ascx.cs:line 114 at
System.Web.UI.Control.OnLoad(EventArgs e) at
System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain()
2.
Login failed for user 'sa'.
Later I changed the COnnectionString to look like the following (I replaced CHARUL\NetSDK with (local))
<?xml version="1.0"?>
<ModuleSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ConnectionString>server=(local);database=ThePhile ;uid=sa;pwd=;</ConnectionString>
</ModuleSettings>
I still get an error but it is different ...
Page Error
--------------------------------------------------------------------------------
An unexpected error has occurred on this page. The system administrators have been notified.
Please feel free to contact us with the information surrounding this error.
The error occurred in:
http://localhost/thephile/Default.aspx
Error Message: Login failed for user 'sa'. Reason: Not associated with a trusted SQL Server connection.
--------------------------------------------------------------------------------
Stack Trace:
System.Data.SqlClient.SqlException: Login failed for user 'sa'. Reason: Not associated with a
trusted SQL Server connection. at
System.Data.SqlClient.ConnectionPool.GetConnection (Boolean& isInTransaction) at
System.Data.SqlClient.SqlConnectionPoolManager.Get PooledConnection(SqlConnectionString options,
Boolean& isInTransaction) at System.Data.SqlClient.SqlConnection.Open() at
Wrox.WebModules.Data.DbObject.RunProcedure(String storedProcName, IDataParameter[] parameters,
Int32& rowsAffected) in C:\wrox\ThePhile\Modules\Core\DbObject.cs:line 104 at
Wrox.WebModules.Polls.Data.Questions.GetCurrentID( ) in
C:\wrox\ThePhile\Modules\Polls2\Polls.Data\Questio ns.cs:line 94 at
Wrox.WebModules.Polls.Business.Question.GetCurrent ID() in
C:\wrox\ThePhile\Modules\Polls2\Polls.Business\Que stion.cs:line 129 at
Wrox.WebModules.Polls.Web.Controls.User.Poll.DataB ind() in
C:\wrox\ThePhile\Modules\Polls2\Poll.ascx.cs:line 123 at
Wrox.WebModules.Polls.Web.Controls.User.Poll.Page_ Load(Object sender, EventArgs e) in
C:\wrox\ThePhile\Modules\Polls2\Poll.ascx.cs:line 114 at
System.Web.UI.Control.OnLoad(EventArgs e) at
System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at
System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain()
3.
So here's another data point. If you discover how to get rid of the login failed error, please let me know and I'll do the same.
4.
Did I modify the ConnectionString correctly?
Thanks.
-Ted