Wrox Programmer Forums
|
ASP.NET 3.5 Professionals If you are an experienced ASP.NET programmer, this is the forum for your 3.5 questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Professionals section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 17th, 2008, 02:58 PM
Authorized User
 
Join Date: Jun 2008
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to workidoo
Default Server Error in '/' Application.

When I run the page loacl on my computer everything works fine. But when I upload it on a server and test it, I get error on "MyProfile.aspx" page. This is how the error message looks like:

Server Error in '/' 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 106: End Get
Line 107: Set
Line 108: Me.SetPropertyValue("CompanyId", value)
Line 109: End Set
Line 110: End Property

Source File: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temp orary ASP.NET Files\root\02a504ec\49b021f4\App_Code.wbml5gsb.1.v b Line: 108

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.OnErro r(SqlException exception, Boolean breakConnection) +800131
   System.Data.SqlClient.TdsParser.ThrowExceptionAndW arning(TdsParserStateObject stateObj) +186
   System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject) +737554
   System.Data.SqlClient.SqlInternalConnectionTds.Att emptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +114
   System.Data.SqlClient.SqlInternalConnectionTds.Log inNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +421
   System.Data.SqlClient.SqlInternalConnectionTds.Ope nLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +181
   System.Data.SqlClient.SqlInternalConnectionTds..ct or(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +173
   System.Data.SqlClient.SqlConnectionFactory.CreateC onnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +133
   System.Data.ProviderBase.DbConnectionFactory.Creat ePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +30
   System.Data.ProviderBase.DbConnectionPool.CreateOb ject(DbConnection owningObject) +424
   System.Data.ProviderBase.DbConnectionPool.UserCrea teRequest(DbConnection owningObject) +66
   System.Data.ProviderBase.DbConnectionPool.GetConne ction(DbConnection owningObject) +494
   System.Data.ProviderBase.DbConnectionFactory.GetCo nnection(DbConnection owningConnection) +82
   System.Data.ProviderBase.DbConnectionClosed.OpenCo nnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105
   System.Data.SqlClient.SqlConnection.Open() +111
   System.Web.DataAccess.SqlConnectionHolder.Open(Htt pContext context, Boolean revertImpersonate) +84
   System.Web.DataAccess.SqlConnectionHelper.GetConne ction(String connectionString, Boolean revertImpersonation) +197
   System.Web.Profile.SqlProfileProvider.GetPropertyV aluesFromDatabase(String userName, SettingsPropertyValueCollection svc) +782
   System.Web.Profile.SqlProfileProvider.GetPropertyV alues(SettingsContext sc, SettingsPropertyCollection properties) +428
   System.Configuration.SettingsBase.GetPropertiesFro mProvider(SettingsProvider provider) +404
   System.Configuration.SettingsBase.SetPropertyValue ByName(String propertyName, Object propertyValue) +170
   System.Configuration.SettingsBase.set_Item(String propertyName, Object value) +89
   System.Web.Profile.ProfileBase.SetInternal(String propertyName, Object value) +139
   System.Web.Profile.ProfileBase.set_Item(String propertyName, Object value) +71
   System.Web.Profile.ProfileBase.SetPropertyValue(St ring propertyName, Object propertyValue) +8
   ProfileCommon.set_CompanyId(String Value) in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temp orary ASP.NET Files\root\02a504ec\49b021f4\App_Code.wbml5gsb.1.v b:108
   MyProfile.btnSave_Click(Object sender, EventArgs e) in D:\hshome\workidoo\workidoo.com\MyProfile.aspx.vb: 37
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
   System.Web.UI.WebControls.Button.RaisePostBackEven t(String eventArgument) +107
   System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String eventArgument) +7
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +11
   System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746



--------------------------------------------------------------------------------

Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433



I use asp.net profile propeties and believe it is somewhere in the Web.config file that I have done wrong. This is how the code behinde looks like on "MyProfile.aspx" -page:



Partial Class MyProfile
Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then

txtCompanyId.Text = Profile.CompanyId

txtCompanyName.Text = Profile.CompanyName

txtImage.Text = Profile.Image

txtAdress.Text = Profile.Adress

txtPostalCode.Text = Profile.PostalCode

txtCity.Text = Profile.City

txtPhoneNumber.Text = Profile.PhoneNumber

txtFaxNumber.Text = Profile.FaxNumber

txtEmail.Text = Profile.Email

txtHomePageAdress.Text = Profile.HomePageAdress

txtAbout.Text = Profile.About

End If

Dim dtNow As Date = DateTime.Now
Using db As New workidooDataContext

Dim TotalWork = (From s In db.Works _
Select s).Count

Dim TotalWorkToday = (From s In db.Works _
Where s.Createt = Today _

Select s.Createt).Count
lblTotalWork.Text = TotalWork

lblTotalWorkToday.Text = TotalWorkToday

End Using

End Sub

Protected Sub btnSave_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSave.Click
If Page.IsValid Then

Profile.CompanyId = txtCompanyId.Text

Profile.CompanyName = txtCompanyName.Text

Profile.Image = txtImage.Text

Profile.Adress = txtAdress.Text

Profile.PostalCode = txtPostalCode.Text

Profile.City = txtCity.Text

Profile.PhoneNumber = txtPhoneNumber.Text

Profile.FaxNumber = txtFaxNumber.Text

Profile.Email = txtEmail.Text

Profile.HomePageAdress = txtHomePageAdress.Text

Profile.About = txtAbout.Text

End If

End Sub
End Class



If I comment the entire code inside "If End" under Page_Load Sub, the page will loaded without problems, the same thing is abolut code below Sub btnSave_Click, I get also the same error when I click the save button.

Plz Help me!


http://www.workidoo.com
__________________
http://www.workidoo.com
 
Old November 17th, 2008, 03:51 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

There are a handful of things to check on this.

First, in SQL Server Management Studio ( I am assuming SQL2K5+ here ) right click on your database instance, select properties, then go to the connections setting found in the left pane. Make sure the 'Allow remote connections to this Server" is ticked. Go to the Security setting found directly above the Connections setting in the left pane and make sure that SQL Server and Windows Authentication Mode is ticked off under Server Authentication.

Finally, make sure that your connection string is pointed correctly and you have supplied the correct credentials.

hth.
-Doug

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor / Author :.
Wrox Books 24 x 7
================================================== =========
 
Old November 18th, 2008, 02:13 PM
Authorized User
 
Join Date: Jun 2008
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to workidoo
Default

Hi,

Thx for the answer but I can not find any of those settings that you are writing about. I connect to the database thru Microsoft SQL Server 2005 Express.

http://www.workidoo.com
 
Old November 18th, 2008, 03:42 PM
Lee Dumond's Avatar
Wrox Author
 
Join Date: Jan 2008
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
Default

Go to Microsoft SQL Server 2005 > Configuration Tools > SQL Server Surface Area Configuration.

Choose "Surface Area Configuration for Services and Connections".

In the tree in the left pane, choose the database instance you want to configure (probably labeled SQLEXPRESS). Under that, expand the Database Engine node, then click on "Remote Connections".

Select the "Local and remote connections" option, with "Using TCP/IP" also selected.

Let us know how you make out.




_________________________________

Visit my blog at http://leedumond.com
 
Old November 18th, 2008, 04:35 PM
Authorized User
 
Join Date: Jun 2008
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to workidoo
Default

 the error was that I missed <remove name="LocalSqlServer"/> in web.config


http://www.workidoo.com
 
Old January 7th, 2009, 04:28 AM
Registered User
 
Join Date: Jan 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Question From NYK

Hi guys,

As we know that ASP.net is a very powerful language. This language is based on C# coding. But I want to know about a server error that will happen in last stage. This problem exist in '/' application.

NYK
Cash Surveys
 
Old January 7th, 2009, 04:19 PM
Friend of Wrox
 
Join Date: Dec 2008
Posts: 238
Thanks: 2
Thanked 20 Times in 19 Posts
Default

I would rather call ASP.Net a framework, and I certainly will not say that it is based on c#.

Quote:
Originally Posted by NYK007 View Post

As we know that ASP.net is a very powerful language. This language is based on C# coding.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Server Application Error Picabrillo BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 12 May 16th, 2006 06:08 AM
Server Error in '/' Application jamesbie ASP.NET 1.0 and 1.1 Basics 2 October 18th, 2005 05:35 AM
Server Application Error cis BOOK: Beginning ASP.NET 1.0 2 February 12th, 2004 06:55 PM





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