I am trying to run the examples that came with the book ASP.NET Website Programming Prob-Design-Solution and i keep getting this error.
I changed all the web.config file to include Server=(local)\SQLSERVER;user id=sa;password=; and the config files in the config folder to server=(local)\SQLSERVER;database=thephile;uid=sa; pwd=;
This is the error i get: 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 119 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()
I know the server is working, as well as the sa account and the "thephile" database because i creadted a console ap in c# that just connected to the database, using both of the above strings, and it connected with no problem. I've even tried chganing the DBObject.cs file so that the connection string is hardcoded, but then i get other errors like Error Message: Could not find stored procedure 'sp_Polls_GetCurrentQuestionID'
Does anyone know why i can't get the sql connection to work?