p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 (http://p2p.wrox.com/forumdisplay.php?f=228)
-   -   Database Problem /Chapter 03 Wrox United Example (http://p2p.wrox.com/showthread.php?t=47932)

dynamicarray September 16th, 2006 02:03 PM

Database Problem /Chapter 03 Wrox United Example
I am trying to do the examples from Chapter 03 with the Wrox United files but when i go to run the site I am getting this error message.

Server Error in '/WroxUnited' Application.
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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: 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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

Source Error:

Line 112: Public Overridable Property Theme() As String
Line 113: Get
Line 114: Return CType(Me.GetPropertyValue("Theme"),String)
Line 115: End Get
Line 116: Set

Source File: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temp orary ASP.NET Files\wroxunited\23e58e6c\d0079918\App_Code.1lwpdy o2.5.vb Line: 114

Stack Trace:

[SqlException (0x80131904): 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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)]
System.Data.SqlClient.SqlInternalConnection. OnError(SqlException exception, Boolean breakConnection) +117
System.Data.SqlClient.TdsParser.ThrowExcepti onAndWarning(TdsParserStateObject stateObj) +346
System.Data.SqlClient.TdsParser.Connect(Bool ean& useFailoverPartner, Boolean& failoverDemandDone, String host, String failoverPartner, String protocol, SqlInternalConnectionTds connHandler, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject, Boolean aliasLookup) +1091
System.Data.SqlClient.SqlInternalConnectionT ds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +1083
System.Data.SqlClient.SqlInternalConnectionT ds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +272
System.Data.SqlClient.SqlConnectionFactory.C reateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +351
System.Data.ProviderBase.DbConnectionFactory .CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +82
System.Data.ProviderBase.DbConnectionPool.Cr eateObject(DbConnection owningObject) +558
System.Data.ProviderBase.DbConnectionPool.Us erCreateRequest(DbConnection owningObject) +126
System.Data.ProviderBase.DbConnectionPool.Ge tConnection(DbConnection owningObject) +651
System.Data.ProviderBase.DbConnectionFactory .GetConnection(DbConnection owningConnection) +160
System.Data.ProviderBase.DbConnectionClosed. OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +122
System.Data.SqlClient.SqlConnection.Open() +229
System.Web.DataAccess.SqlConnectionHolder.Op en(HttpContext context, Boolean revertImpersonate) +114
System.Web.DataAccess.SqlConnectionHelper.Ge tConnection(String connectionString, Boolean revertImpersonation) +225
System.Web.Profile.SqlProfileProvider.GetPro pertyValuesFromDatabase(String userName, SettingsPropertyValueCollection svc) +1005
System.Web.Profile.SqlProfileProvider.GetPro pertyValues(SettingsContext sc, SettingsPropertyCollection properties) +467
System.Configuration.SettingsBase.GetPropert iesFromProvider(SettingsProvider provider) +325
System.Configuration.SettingsBase.GetPropert yValueByName(String propertyName) +372
System.Configuration.SettingsBase.get_Item(S tring propertyName) +142
System.Web.Profile.ProfileBase.GetInternal(S tring propertyName) +52
System.Web.Profile.ProfileBase.get_Item(Stri ng propertyName) +91
System.Web.Profile.ProfileBase.GetPropertyVa lue(String propertyName) +29
ProfileCommon.get_Theme() in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temp orary ASP.NET Files\wroxunited\23e58e6c\d0079918\App_Code.1lwpdy o2.5.vb:114
Wrox.Web.GlobalEvents.ThemeModule.app_PreReq uestHandlerExecute(Object Sender, EventArgs E) in C:\BegASPNET2\Chapters\Begin\Chapter03\WroxUnited\ App_Code\ThemeModule.vb:30
System.Web.SyncEventExecutionStep.System.Web .HttpApplication.IExecutionStep.Execute() +167
System.Web.HttpApplication.ExecuteStep(IExec utionStep step, Boolean& completedSynchronously) +117

DanM September 25th, 2006 12:25 PM

Hi there,

It looks like you're having trouble hooking up your site to the database. Can I check with you that you have both Visual Web Developer Express and SQL Server Express installed and running?

If so, then can you try the following

- Go to the download for Chapter 3 you got from the wrox website.
- Unzip it into a new directory
- Open VWD, and click File | Open Website
- Navigate to the new WroxUnited directory you created when you unzipped the download and hit OK.
- When the website has been loaded in VWD, press F5 to run the website.
- The site should load correctly.

I've verified this works with both the Chapter 3 single download and the code for chapter 3 in the full book download. You can get both at

If it's still not working, please let me know and we'll go from there.

Thanks, Dan

jbbagman January 17th, 2007 01:13 AM

I am having the same problem as Dynamicarray is, same exact error. My question is I don't know how to tell if SQL Server Express is running or not, or if it is configured correctly. When I press Start and All Programs, I see Microsoft SQL Server 2005, and then I press that icon, and I get the Configuration tools folder with the following items: SQL Server Configuration Manager, Error and Usage Reporting, and Surface Area Configuration. Does that mean Microsoft SQL 2005 Express Edition is set up? Do I have to change anything with the Configuration tools? Should there be an executable for Microsoft SQL 2005 Express Edition that I should click on. I checked in the Visual Basic 2005 Express Edition, and the icon is there for the SQL Database in Add New Item under Program. The problem I'm having with chapter 3 of Visual Basic 2005 Express Edition is knowing how to tell if everything is set up correctly for the SQL Database, or as I mentioned before do I have to configure anything with the configuration tools. This Wrox Press book doesn't give enough information about Microsoft SQL 2005 Express Edition setup or configuration. I have sat here for hours tring to figure how to bring up this database which shouldn't have taken more than a couple of minutes. Usually, I like Wrox materials, but I wouldn't give this to a beginning programmer, unless I hated that person.

Jim Bagby

DanM February 12th, 2007 09:24 AM

Hi Jim,

The easiest way to tell if SQL Express is running is go to Start Menu>Control Panel>Administrative Tools>Services and see if you can find SQL Express in that listing and that it is 'started' and start it if not.

If you're running SQL Express on the same machine as your website, then no you shouldn't need to do anything else because SQL Express should pick up the database files from your websites app_data file automatically and make them available to the site.

If you're comfortable with SQL and command line utilities, the best way to make sure a SQl Express database is working as expected is to use the sseutil app available here - http://www.microsoft.com/downloads/d...DisplayLang=en. There's a rundown of useful commands for it here. http://weblogs.asp.net/scottgu/archi...15/433284.aspx

The idea behind using SQL Express was that you just install it as part of VWD and it works out of the box. The issue is that its a bit of a black box if it starts not to work. Ah well. Just mail back here or check in the SQL Server forums here on wrox.com if you need more help.


Dan Maharry
Read the feed at http://feeds.feedburner.com/dansarchive

All times are GMT -4. The time now is 11:45 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.